Re: [R] Turn factors to numeric

2008-10-10 Thread John Kane
Grothendieck warns that this last can possibly cause problems when using R programs from other places. I ran into this problem once with reshape. --- On Thu, 10/9/08, Michael Kubovy [EMAIL PROTECTED] wrote: From: Michael Kubovy [EMAIL PROTECTED] Subject: Re: [R] Turn factors to numeric To: Charilaos

[R] Turn factors to numeric

2008-10-09 Thread joseph kambeitz
I am having some problems while trying to fit simple data. I aggregated some data using: data1 - aggregate(data1$T2, list=(SOA=data1$SOA), mean) unfortunatly this coerces my variable SOA into a factor. Therefore when a afterwards try to fit a simple equation to my variable T2 using a formula on

Re: [R] Turn factors to numeric

2008-10-09 Thread Charilaos Skiadas
R-FAQ 7.10: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors- to-numeric_003f On Oct 9, 2008, at 6:59 AM, joseph kambeitz wrote: I am having some problems while trying to fit simple data. I aggregated some data using: data1 - aggregate(data1$T2, list=(SOA=data1$SOA),

Re: [R] Turn factors to numeric

2008-10-09 Thread Michael Kubovy
Dear R-helpers, The FAQ in question says: It may happen that when reading numeric data into R (usually, when reading in a file), they come in as factors. If f is such a factor object, you can use as.numeric(as.character(f)) to get the numbers back. More efficient, but harder to