[R] sweave tables as images?

Alexander Shenkin ashenkin at ufl.edu
Mon May 21 22:29:40 CEST 2012


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



More information about the R-help mailing list