How to change a factor to numeric is FAQ 7.10 Also look at the `colClasses` argument to read.table/read.csv for a way to specify the type of the column when you are reading it in.
On Mon, Nov 26, 2012 at 8:59 AM, EcoFranc <rob...@gmx.de> wrote: > Hi, > > maybe somebody would be kind enough to help a bloody and unprofessional > beginner like me (and I hope I did not overlook the answer to my question > on > the website). I've imported a csv data frame into R, but I can't run a > regression because R interprets 4 out of 5 variables as factors (rather > than > numeric vectors). I tried the as.numeric() command, but R says it is > invalid > to change the storage mode of a factor. Is there any way to change the mode > of a factor into numeric. > > I am very grateful for help. Thank you very much, Robert. > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/wrong-data-interpretation-in-R-tp4650849.html > Sent from the R help mailing list archive at Nabble.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. > -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com [[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.