[R] replaing 1-digit months with 2-digit months in a date

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Tue Nov 9 18:28:19 CET 2010


Hello again!

Sorry, if it's a simple question - I am very bad in working with strings.

I have a vector of strings:
x<-c("2000.1","2000.2","2000.10","2000.12")

I'd like to change it so that it the month always has 2 digits, like this:

"2000.01","2000.02","2000.10","2000.12"


Is it possible?
Thanks a lot!
-- 
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com



More information about the R-help mailing list