[R] printing tables to a pdf

Greg Snow Greg.Snow at imail.org
Fri Feb 29 20:15:10 CET 2008


There are a few different ways that this can be accomplished.

The method I would suggest is to use one of the variants of Sweave.

You can either use the original Sweave (?Sweave) or the odfWeave
package.

Using the original Sweave you would create a template file that combines
LaTeX commands (headers, etc.) and instructions to R on how to create
your tables.  Running this through  the Sweave function in R will create
a LaTeX file that you can then process to create a pdf file (using
pdflatex or similar).

The odfWeave package works similarly, but instead of the template using
LaTeX commands, you create the template file using open office
(http://www.openoffice.org) which is a free program that is compatible
with MS office (Word for this case).  You again create a document that
includes the headers and other information, then also include R commands
for creating the tables (there is an odfTable function to help with
this).  Process the template file with the odfWeave function and you end
up with another openoffice document, but this time it has your tables
included.  Open this file with openoffice and use openoffice to convert
it to a pdf file (click of a button, future versions may allow for a
command line conversion).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Georg Ehret
> Sent: Friday, February 29, 2008 11:34 AM
> To: r-help
> Subject: [R] printing tables to a pdf
> 
> Dear R community,
>        I wish to print tables into a pdf file. How can this 
> be done, adding headers and several tables to the same file?
> 
> Thanking you for your attention,
> Georg.
> *****************************
> Georg Ehret
> Johns Hopkins
> Baltimore - US
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.
> 



More information about the R-help mailing list