Hi Sonia, This suggests that those columns have something in them that is not numeric (e.g., "." to represent missing data, text, etc.). You can avoid them being converted to factor using:
read.csv("yourfile.csv", stringsAsFactors = FALSE) however, they will still be character class, not numeric. You will then either need to use as.numeric() on those columns, or figure out what is making R think those are character columns in the first place and correct that in your CSV file. Cheers, Josh On Thu, Oct 21, 2010 at 7:17 PM, mou sonia <paperh...@gmail.com> wrote: > Hi, > > I'm using read.csv to import a table. But sevel columns are changed to > factor variables automatically. They are actually numbers not factor levels. > Why this happened? How can I get the correct table? Thanks a lot. > > Sonia > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.