[R] DISPLAYING TABLE in file

Rolf Turner r.turner at auckland.ac.nz
Fri Mar 26 02:01:14 CET 2010


On 26/03/2010, at 1:36 PM, Geddes, Scott wrote:

> 
> Hi,
> 
> I wish to NEATLY store, and later display one table per file (similar to
> capabilities of write.table()).
> 
> BUT BY NEATLY I MEAN:
> 1. Column Headings right aligned with data values.
> 2. Decimal points line-up per column.
> 3. Data values padded trailing zeros per column (if not integers).
> 4. "Tricky" formats such as certain characters/dates possibly chosen by
> the user?
> 
> bla bla bla 
> 
> I do not care about increased memory storage but my main concern is to
> DISPLAY contents of file.


If by ``table'' you mean data frame, you can get most (???) of what you want
by doing:

sink("neat.txt")
print(xxx,row.names=FALSE)
sink()

To get things exactly as you want them, you might have to mess around
using sprintf() on the (numeric) columns of the data frame xxx before
printing it.  There is almost surely nothing ``off the peg'' that does
exactly what you want.

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list