[R] read.table as integer

Francisco franciscororolaio at google.com
Fri Jan 13 13:02:52 CET 2012


Hello,
I have a csv file with many variables, both characters and integers.
I would like to load it on R and do some operations on integer 
variables, the problem is that R loads the entire dataset considering 
all variables as characters, instead I would like that R makes the 
distinction between the two types, because there are too many variables 
to do:
x1<-as.integer(x1)
x2<-as.integer(x2)
x3<-as.integer(x3)
...

I tried to specify read.table(... stringsAsFactors=FALSE) but it doesn't 
work.

Thanks,
Best Regards



More information about the R-help mailing list