[R] sprintf does not fill with "0"?!

Oliver Bandel oliver at first.in-berlin.de
Mon Sep 15 23:19:12 CEST 2008


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



More information about the R-help mailing list