I've used formatC to adding leading zeroes when needed but I'm currently working with census tracts that require I add trailing zeroes with no decimal. I've read through the options but can't see a way formatC places the zeroes to the end without making them decimals places? Any thoughts are much appreciated.
tract<-c(1,11,101,1001,10001,100001)
formatC(tract,width=6,format="d",flag="0")