[R] convert factor data to numeric
sdmaillist at gmail.com
Wed Jan 13 19:03:44 CET 2010
On 01/13/2010 05:41 PM, Peter Ehlers wrote:
> S Devriese wrote:
>> On 01/13/2010 10:47 AM, Ahmet Temiz wrote:
>>> could you give me a hint to convert data in factor type to numeric
>>> (float) ?
>>> 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
> 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
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
I know, slightly sloppy answer (see Dimitri's answer), but I hoped to
find out how he got the factor in the first place, because if it is an
import issue (and e,g. decimal character is different from the locale
decimal character) the FAQ answer might not work as expected.
More information about the R-help