[R] using sprintf with dates

stephen bond stenka1 at go.com
Tue Oct 2 15:36:27 CEST 2007


hello,

Please help with using sprintf with character variables:
The following does not produce what i intended

foot=function(){
  str1=format(Sys.Date,"%Y%m%d")
  sprintf("99%-4s%s","nm",str1)
}

I wanted to have "99nm  20071002" as the output.



More information about the R-help mailing list