On Aug 10, 2012, at 6:39 PM, sharx wrote:

Does anyone know of a way to specify the alignment of individual columns in a data frame so that after using write.table the columns are aligned in the
file?

Do you mean by padding with spaces? set numzer.pad to the desired width and then perhaps using

lapply(dfrm, function(x) sprintf(paste('%0', numzer.pad, 'i', sep=''), x)

You might need to check for the class of the columns because the letter in the format string for sprintf is different fo numbers and characters.

--

David Winsemius, MD
Alameda, CA, USA

______________________________________________
R-help@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.

Reply via email to