Skip to content
Prev 303100 / 398503 Next

Align columns in data frame write.table

I do not know of any option in write.table() that would allow a
variable spacer, such as padding with spaces to make columns centered
or right aligned.  Everything is just separated somehow.  You could
look at ?format or ?sprintf which have padding/alignment options.
Once you had properly padded character data, you could just use
writeLines() to push it to a file.

Cheers,

Josh
On Fri, Aug 10, 2012 at 6:39 PM, sharx <sxu12 at mtlakes.org> wrote: