[R] printing tabular data nicely

Marcus Davy MDavy at hortresearch.co.nz
Fri Jun 4 01:23:00 CEST 2004

If you choose to use LaTeX and xtable, you can also enhance the visual
of the output tables using the booktab LaTeX package. Have a look at:


You can change the horizontal line tags \hline to \toprule, \midrule,
and \bottomrule, at your discretion. 
There was also a recent thread about rownames quirks with xtable:



>>> Duncan Murdoch <dmurdoch at pair.com> 4/06/2004 7:06:14 AM >>>
On Thu, 03 Jun 2004 10:19:26 -0700, wwsprague at ucdavis.edu wrote :

>Hi R-heplers,
>I would like to print various matrices, dataframes, tables, etc to 
>files, preferably nicely formatted postscript for import into papers.

>Is there a way to do this?
>I know ?cat, ?writeLines, ?format, ?paste.  But I am not sure of a
>combination of these in order to get a nice looking table of
>Any ideas?  I guess I want (almost) publication ready output, just
>you get for "plot"...
>(I *don't* want to print to the console, btw)

As Sundar said, xtable is probably what you want.  You may also
benefit from the fairly new "addmargins" function.

Duncan Murdoch

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide!


The contents of this e-mail are privileged and/or confidenti...{{dropped}}

More information about the R-help mailing list