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? Many thanks. -Serge
Serge Boiko <boiko at demogr.mpg.de> 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