[R] Problem with converting factors to numbers

Duncan Murdoch murdoch.duncan at gmail.com
Tue Sep 20 13:32:47 CEST 2011


On 11-09-20 7:25 AM, _Luc_ wrote:
> ok great, as.numeric(as.character(data$x)) works perfectly.
>
> I am sorry that i did not find this before making this post.
>
>
> @ peter
> what did not work was:
> data$x2<- as.character(data$x)
> data$x3<- as.numeric(data$x2)

That should have worked.  Can you put together a simple example where it 
doesn't?

Duncan Murdoch



More information about the R-help mailing list