[R] Formating numbers

2008-05-05 Thread pecardoso
Maybe a very, very basic question but how can I get a vector of values with the specific format: 001,002,010,100 instead of: 1,2,10,100 Paulo De: [EMAIL PROTECTED] em nome de Stephan Moratti Enviada: seg 05-05-2008 11:43 Para: r-help@r-project.org Assunto:

Re: [R] Formating numbers

2008-05-05 Thread Charilaos Skiadas
On May 5, 2008, at 7:03 AM, pecardoso wrote: Maybe a very, very basic question but how can I get a vector of values with the specific format: 001,002,010,100 instead of: 1,2,10,100 Not perfect, but might get you started: sprintf(%03d,c(8:10,101)) or formatC(c(8:10,101), width=3, flag=0)