Re: [R] Problem with converting factors to numbers

2011-09-20 Thread Duncan Murdoch
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 togethe

Re: [R] Problem with converting factors to numbers

2011-09-20 Thread _Luc_
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) -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-

Re: [R] Problem with converting factors to numbers

2011-09-20 Thread Petr PIKAL
Hi > > [R] Problem with converting factors to numbers > > Hi all, > I have a very simple problem, but i cant find a solution probably because i > search for the wrong keywords. > > I have coordinates x and y. They look like this: > > > str(data) > '

Re: [R] Problem with converting factors to numbers

2011-09-20 Thread Jim Holtman
this is an FAQ (forget which one), but the solution is: as.numeric(as.character(data$x)) Sent from my iPad On Sep 20, 2011, at 3:40, _Luc_ wrote: > Hi all, > I have a very simple problem, but i cant find a solution probably because i > search for the wrong keywords. > > I have coordinates x a

[R] Problem with converting factors to numbers

2011-09-20 Thread _Luc_
Hi all, I have a very simple problem, but i cant find a solution probably because i search for the wrong keywords. I have coordinates x and y. They look like this: > str(data) 'data.frame': 13979 obs. of 2 variables: $ x : Factor w/ 3815 levels "","186011.4971280",..: 1528 1524