I\'ve been looking into this for the past few hours. I have tried using sprintf
but it changes the column to character. All I want to do is to have a fixed-widt
If you give more context we might be able to help you solve your ultimate (rather than proximal) problem, e.g. if you need output in this format but without quotation marks:
> cat(sprintf("%04d",5),"\n")
0005
## or
> print(sprintf("%04d",5),quote=FALSE)
[1] 0005
write.csv(...,quote=FALSE)
might be helpful too