[R] Convert character string to number

Ken Liu tyliu0522 at yahoo.com
Sat Jun 21 01:36:54 CEST 2008


Hi,

I would like to convert a character vector

xxx <- c("1/2", "1/4")

to 

yyy <- c(0.5, 0.25)


, but as.numeric didn't work for me.  Could anyone give me a hint please?

Thanks,
Ken



More information about the R-help mailing list