sprintf does not fill with "0"?!
Try
sprintf("%03.0f", 1:5)
formatC(1:5, width=3, flag="0")
Regards, Adai
Oliver Bandel wrote:
Hello, please look here: =================================================================
sprintf("%03s", as.character(1:5))
[1] " 1" " 2" " 3" " 4" " 5" ================================================================= There should be a leading "0" isntead of space-chars?! I use R version 2.6.2 (2008-02-08) Ciao, Oliver
______________________________________________ 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.