[R] as.character ()

benlafleche benlafleche at gmail.com
Mon Mar 31 23:45:16 CEST 2008


Hello,

I'm trying to tranform a numeric vector into a character vector.

 > x=c(2.00,1.20,5.00,6.56)
 > y= as.character(x)
 > y
[1] "2"    "1.2"  "5"    "6.56"

What I want is :

[1] "2.00"    "1.20"  "5.00"    "6.56"


Does someone know how to do this please ?


Benoit Bruneau



More information about the R-help mailing list