[R] From numeric vector to string vector

Dieter Menne dieter.menne at menne-biomed.de
Sun Feb 13 16:51:02 CET 2011



Bogaso wrote:
> 
> Vect <- c(12.234, 234.5675, 1.5)
> Now I want a string vector like:
> changedVec <- c("012.234", "234.568", "001.500")
> 

sprintf("%06.3f", c(12.234, 234.5675, 1.5))

Dieter


-- 
View this message in context: http://r.789695.n4.nabble.com/From-numeric-vector-to-string-vector-tp3303712p3303730.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list