Serge Boiko <[EMAIL PROTECTED]> writes: > Hi there; > In order to convert sting to number I do: > s <- "22" > mode(s) <- "integer" # "double", etc. will do > > Is that a "preferred" way?
Coersion functions are preferred.
> as.integer("22")
[1] 22
> as.numeric("22")
[1] 22
If you have the methods package attached you can use
> as("22", "numeric")
[1] 22
______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
