[R] convert factor data to numeric

Peter Ehlers ehlers at ucalgary.ca
Wed Jan 13 17:41:12 CET 2010


S Devriese wrote:
> On 01/13/2010 10:47 AM, Ahmet Temiz wrote:
>> hello
>>
>>  could you give me a hint to convert data in factor type to numeric (float) ?
>>
>>   regards
>>
>> --
>> Open WebMail Project (http://openwebmail.org)
>>
>>
> you could try as.numeric but without more details it is difficult to see
> if this will work. How did you end up with a factor (e.g. through import)?
> 
No, don't use as.numeric(). Do follow Dimitris' advice.
But the question of how you got the factor data is good; you
can usually avoid getting factors to begin with.

  -Peter Ehlers

> Stephan
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
Peter Ehlers
University of Calgary
403.202.3921



More information about the R-help mailing list