Re: [R] convertin a data frame column from character to numeric

2008-02-08 Thread Henrique Dallazuanna
Try this: x <- cbind(x[1],sapply(x[,2:3], as.numeric)) On 08/02/2008, joseph <[EMAIL PROTECTED]> wrote: > I have a data.frame with all character columns, I would like to convert the > last two columns into numeric.> x[1:5, ] chrNstart end > 1 chr1 7131003

[R] convertin a data frame column from character to numeric

2008-02-08 Thread joseph
I have a data.frame with all character columns, I would like to convert the last two columns into numeric.> x[1:5, ] chrNstart end 1 chr1 71310034 71310064 2 chr14 23354088 23354118 3 chr14 71310034 71310064 4 chr15 37759058 37759088 5 chr22 18262