[R] as.character ()

From: benlafleche <benlafleche_at_gmail.com>
Date: Mon, 31 Mar 2008 17:45:16 -0400


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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 31 Mar 2008 - 21:53:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 31 Mar 2008 - 22:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive