[R] sweave tables as images?

R. Michael Weylandt michael.weylandt at gmail.com
Mon May 21 22:33:03 CEST 2012


Take a look at addtable2plot in plotrix or grid.table / tableGrob in
gridExtras.

Michael

On Mon, May 21, 2012 at 4:29 PM, Alexander Shenkin <ashenkin at ufl.edu> wrote:
> Hello folks,
>
> I've been on a journey trying to figure out how to manage documents that
> are amenable to sharing and editing, but that contain dynamic content
> generated by R.  I've come to the following solution: I use Sweave to
> generate labeled png & pdf figures, and I "Insert & Link" those figures
> as "Pictures" in a Word 2010 doc.  Thus, when data or code changes, I
> regenerate the figures with Sweave, open the Word doc and hit "F9", and
> all the figures are automatically updated.  I can send the file around,
> folks can comment and edit, track changes, etc.
>
> Now, however, I'm trying to do the same for tables that I did for
> figures, and it seems a bit more difficult.  I can spit out tex tables
> into separate files using the "split=TRUE" chunk option, and I can even
> make those tables into html with xtable(type="html").  Word, however,
> doesn't have the "Insert & Link" option for external text files (which
> makes it such that, if the external file isn't found, Word uses a copy
> stored in the doc).
>
> So, I think it will be better if I can somehow generate the tables as
> images.  Is there any way to generate tables as images in separate files
> in Sweave?  Or, is there another tree up which I should be barking?
>
> Thanks,
> Allie
>
> ______________________________________________
> 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