Re: [R] sweave tables as images?

2012-05-25 Thread Yihui Xie
The hook function hook_pdfcrop() also works on PNG images, although
the function name is somehow misleading. The requirement is that you
have ImageMagick installed and the command 'convert' is in your PATH.
It is a contribution from @r2d3
https://github.com/yihui/knitr/issues/209#issuecomment-5266580

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Fri, May 25, 2012 at 4:16 PM, Alexander Shenkin  wrote:
> Thanks Yihui,
>
> That's a great idea, and comes close to the mark, except that I have to
> use png's in order to "Insert & Link" them as pictures in Word (and
> hence make the doc both shareable and update when new figures are
> generated).
>
> thanks,
> allie

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread Yihui Xie
Normally I hate the device()+code+dev.off()+cat('\\includegraphics{})
trick. Let me show you how trivial this can be in knitr:
https://gist.github.com/2790922

This example shows the real source code to the reader
(device()+dev.off() makes no sense to them), and leaves all the dirty
tricks behind the scene.

That being said, Sweave can be regarded as a subset of knitr, so if
you really want to play the old trick, you still can do it in knitr.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Fri, May 25, 2012 at 5:01 PM, baptiste auguie
 wrote:
> My guess is that it would be impossible to use the table size in
> Sweave, only mildly non-trivial in knitr with a proper hook. The
> easiest hack in either of them would be to manually open the png
> device, and use cat() with \includegraphics{} where you want the plot
> diplayed.
>
> HTH,
>
> b.
>
> On 26 May 2012 09:43, Alexander Shenkin  wrote:
>> this works - thanks baptiste!  i'm working in Sweave right now - perhaps
>> it will be tough in knitr as you mention.
>>
>> On 5/25/2012 4:31 PM, baptiste auguie wrote:
>>> you can open a device that has the exact dimensions of the table,
>>>
>>> g = tableGrob(head(iris, 4))
>>> png("test.png", width=convertWidth(grobWidth(g), "in", value=TRUE),
>>>         height=convertHeight(grobHeight(g), "in",
>>> value=TRUE),units="in", res=150)
>>> grid.draw(g)
>>> dev.off()
>>>
>>> Doing this with knitr might be tricky though, since the unit
>>> conversion opens a blank device window, and you'd want to define some
>>> hook instead of manually creating the png file.
>>>
>>> I have another version of grid.table where you can specify the width
>>> and height manually [*], e.g to span the full window, but it's not
>>> necessarily a desirable thing (the spacing between rows and columns
>>> can become too large).
>>>
>>>
>>> HTH,
>>>
>>> baptiste
>>>
>>>
>>> [*] experimental code at https://gist.github.com/2013903
>>>
>>> On 26 May 2012 09:16, Alexander Shenkin  wrote:
 Thanks Yihui,

 That's a great idea, and comes close to the mark, except that I have to
 use png's in order to "Insert & Link" them as pictures in Word (and
 hence make the doc both shareable and update when new figures are
 generated).

 thanks,
 allie

 On 5/25/2012 2:57 PM, Yihui Xie wrote:
> You may take a look at knitr's graphics manual which tells you how you
> can automatically crop the white margins:
> https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping
> PDF Graphics").
>
> I'm not sure if pdfcrop works in this case, though.
>
> Regards,
> Yihui
> --
> Yihui Xie 
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
>
>
> On Fri, May 25, 2012 at 2:44 PM, Alexander Shenkin  
> wrote:
>> grid.table() works well, but using it in sweave creates graphics with
>> very wide margins.  I'm sure this has something to do with grid, and not
>> just grid.table.  Any idea how I can clip the graphic to the edges of
>> the table graphic?  I've looked into viewports, etc, but I can't seem to
>> find anything that will clip a graphic to its edges, perhaps with some
>> defined margin.
>>
>> any help greatly appreciated!
>>
>> thanks,
>> allie

 __
 R-help@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.

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread baptiste auguie
My guess is that it would be impossible to use the table size in
Sweave, only mildly non-trivial in knitr with a proper hook. The
easiest hack in either of them would be to manually open the png
device, and use cat() with \includegraphics{} where you want the plot
diplayed.

HTH,

b.

On 26 May 2012 09:43, Alexander Shenkin  wrote:
> this works - thanks baptiste!  i'm working in Sweave right now - perhaps
> it will be tough in knitr as you mention.
>
> On 5/25/2012 4:31 PM, baptiste auguie wrote:
>> you can open a device that has the exact dimensions of the table,
>>
>> g = tableGrob(head(iris, 4))
>> png("test.png", width=convertWidth(grobWidth(g), "in", value=TRUE),
>>         height=convertHeight(grobHeight(g), "in",
>> value=TRUE),units="in", res=150)
>> grid.draw(g)
>> dev.off()
>>
>> Doing this with knitr might be tricky though, since the unit
>> conversion opens a blank device window, and you'd want to define some
>> hook instead of manually creating the png file.
>>
>> I have another version of grid.table where you can specify the width
>> and height manually [*], e.g to span the full window, but it's not
>> necessarily a desirable thing (the spacing between rows and columns
>> can become too large).
>>
>>
>> HTH,
>>
>> baptiste
>>
>>
>> [*] experimental code at https://gist.github.com/2013903
>>
>> On 26 May 2012 09:16, Alexander Shenkin  wrote:
>>> Thanks Yihui,
>>>
>>> That's a great idea, and comes close to the mark, except that I have to
>>> use png's in order to "Insert & Link" them as pictures in Word (and
>>> hence make the doc both shareable and update when new figures are
>>> generated).
>>>
>>> thanks,
>>> allie
>>>
>>> On 5/25/2012 2:57 PM, Yihui Xie wrote:
 You may take a look at knitr's graphics manual which tells you how you
 can automatically crop the white margins:
 https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping
 PDF Graphics").

 I'm not sure if pdfcrop works in this case, though.

 Regards,
 Yihui
 --
 Yihui Xie 
 Phone: 515-294-2465 Web: http://yihui.name
 Department of Statistics, Iowa State University
 2215 Snedecor Hall, Ames, IA


 On Fri, May 25, 2012 at 2:44 PM, Alexander Shenkin  
 wrote:
> grid.table() works well, but using it in sweave creates graphics with
> very wide margins.  I'm sure this has something to do with grid, and not
> just grid.table.  Any idea how I can clip the graphic to the edges of
> the table graphic?  I've looked into viewports, etc, but I can't seem to
> find anything that will clip a graphic to its edges, perhaps with some
> defined margin.
>
> any help greatly appreciated!
>
> thanks,
> allie
>>>
>>> __
>>> R-help@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.

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread Alexander Shenkin
this works - thanks baptiste!  i'm working in Sweave right now - perhaps
it will be tough in knitr as you mention.

On 5/25/2012 4:31 PM, baptiste auguie wrote:
> you can open a device that has the exact dimensions of the table,
> 
> g = tableGrob(head(iris, 4))
> png("test.png", width=convertWidth(grobWidth(g), "in", value=TRUE),
> height=convertHeight(grobHeight(g), "in",
> value=TRUE),units="in", res=150)
> grid.draw(g)
> dev.off()
> 
> Doing this with knitr might be tricky though, since the unit
> conversion opens a blank device window, and you'd want to define some
> hook instead of manually creating the png file.
> 
> I have another version of grid.table where you can specify the width
> and height manually [*], e.g to span the full window, but it's not
> necessarily a desirable thing (the spacing between rows and columns
> can become too large).
> 
> 
> HTH,
> 
> baptiste
> 
> 
> [*] experimental code at https://gist.github.com/2013903
> 
> On 26 May 2012 09:16, Alexander Shenkin  wrote:
>> Thanks Yihui,
>>
>> That's a great idea, and comes close to the mark, except that I have to
>> use png's in order to "Insert & Link" them as pictures in Word (and
>> hence make the doc both shareable and update when new figures are
>> generated).
>>
>> thanks,
>> allie
>>
>> On 5/25/2012 2:57 PM, Yihui Xie wrote:
>>> You may take a look at knitr's graphics manual which tells you how you
>>> can automatically crop the white margins:
>>> https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping
>>> PDF Graphics").
>>>
>>> I'm not sure if pdfcrop works in this case, though.
>>>
>>> Regards,
>>> Yihui
>>> --
>>> Yihui Xie 
>>> Phone: 515-294-2465 Web: http://yihui.name
>>> Department of Statistics, Iowa State University
>>> 2215 Snedecor Hall, Ames, IA
>>>
>>>
>>> On Fri, May 25, 2012 at 2:44 PM, Alexander Shenkin  wrote:
 grid.table() works well, but using it in sweave creates graphics with
 very wide margins.  I'm sure this has something to do with grid, and not
 just grid.table.  Any idea how I can clip the graphic to the edges of
 the table graphic?  I've looked into viewports, etc, but I can't seem to
 find anything that will clip a graphic to its edges, perhaps with some
 defined margin.

 any help greatly appreciated!

 thanks,
 allie
>>
>> __
>> R-help@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.

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread baptiste auguie
you can open a device that has the exact dimensions of the table,

g = tableGrob(head(iris, 4))
png("test.png", width=convertWidth(grobWidth(g), "in", value=TRUE),
height=convertHeight(grobHeight(g), "in",
value=TRUE),units="in", res=150)
grid.draw(g)
dev.off()

Doing this with knitr might be tricky though, since the unit
conversion opens a blank device window, and you'd want to define some
hook instead of manually creating the png file.

I have another version of grid.table where you can specify the width
and height manually [*], e.g to span the full window, but it's not
necessarily a desirable thing (the spacing between rows and columns
can become too large).


HTH,

baptiste


[*] experimental code at https://gist.github.com/2013903

On 26 May 2012 09:16, Alexander Shenkin  wrote:
> Thanks Yihui,
>
> That's a great idea, and comes close to the mark, except that I have to
> use png's in order to "Insert & Link" them as pictures in Word (and
> hence make the doc both shareable and update when new figures are
> generated).
>
> thanks,
> allie
>
> On 5/25/2012 2:57 PM, Yihui Xie wrote:
>> You may take a look at knitr's graphics manual which tells you how you
>> can automatically crop the white margins:
>> https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping
>> PDF Graphics").
>>
>> I'm not sure if pdfcrop works in this case, though.
>>
>> Regards,
>> Yihui
>> --
>> Yihui Xie 
>> Phone: 515-294-2465 Web: http://yihui.name
>> Department of Statistics, Iowa State University
>> 2215 Snedecor Hall, Ames, IA
>>
>>
>> On Fri, May 25, 2012 at 2:44 PM, Alexander Shenkin  wrote:
>>> grid.table() works well, but using it in sweave creates graphics with
>>> very wide margins.  I'm sure this has something to do with grid, and not
>>> just grid.table.  Any idea how I can clip the graphic to the edges of
>>> the table graphic?  I've looked into viewports, etc, but I can't seem to
>>> find anything that will clip a graphic to its edges, perhaps with some
>>> defined margin.
>>>
>>> any help greatly appreciated!
>>>
>>> thanks,
>>> allie
>
> __
> R-help@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.

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread Alexander Shenkin
Thanks Yihui,

That's a great idea, and comes close to the mark, except that I have to
use png's in order to "Insert & Link" them as pictures in Word (and
hence make the doc both shareable and update when new figures are
generated).

thanks,
allie

On 5/25/2012 2:57 PM, Yihui Xie wrote:
> You may take a look at knitr's graphics manual which tells you how you
> can automatically crop the white margins:
> https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping
> PDF Graphics").
> 
> I'm not sure if pdfcrop works in this case, though.
> 
> Regards,
> Yihui
> --
> Yihui Xie 
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
> 
> 
> On Fri, May 25, 2012 at 2:44 PM, Alexander Shenkin  wrote:
>> grid.table() works well, but using it in sweave creates graphics with
>> very wide margins.  I'm sure this has something to do with grid, and not
>> just grid.table.  Any idea how I can clip the graphic to the edges of
>> the table graphic?  I've looked into viewports, etc, but I can't seem to
>> find anything that will clip a graphic to its edges, perhaps with some
>> defined margin.
>>
>> any help greatly appreciated!
>>
>> thanks,
>> allie

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread Yihui Xie
You may take a look at knitr's graphics manual which tells you how you
can automatically crop the white margins:
https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping
PDF Graphics").

I'm not sure if pdfcrop works in this case, though.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Fri, May 25, 2012 at 2:44 PM, Alexander Shenkin  wrote:
> grid.table() works well, but using it in sweave creates graphics with
> very wide margins.  I'm sure this has something to do with grid, and not
> just grid.table.  Any idea how I can clip the graphic to the edges of
> the table graphic?  I've looked into viewports, etc, but I can't seem to
> find anything that will clip a graphic to its edges, perhaps with some
> defined margin.
>
> any help greatly appreciated!
>
> thanks,
> allie

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-25 Thread Alexander Shenkin
grid.table() works well, but using it in sweave creates graphics with
very wide margins.  I'm sure this has something to do with grid, and not
just grid.table.  Any idea how I can clip the graphic to the edges of
the table graphic?  I've looked into viewports, etc, but I can't seem to
find anything that will clip a graphic to its edges, perhaps with some
defined margin.

any help greatly appreciated!

thanks,
allie

On 5/21/2012 3:33 PM, R. Michael Weylandt wrote:
> 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  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@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.

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-22 Thread Liviu Andronic
On Tue, May 22, 2012 at 3:24 PM, Alexander Shenkin  wrote:
> If I understand it correctly, odfWeave doesn't have a path backwards
> from the odf doc back to the original odfWeave doc (which is the main
> restriction of all these Sweave/knitr/etc solutions in my use case).
> Please correct me if I'm wrong about that!
>
Unfortunately I cannot help you with this specific question, not least
because I've never used odfWeave.

>From a quick glance to the docs, it seems that you always have two
documents: source odfWeave .odt (equivalent to .Rnw) and output .odt
(equivalent to .tex). Then using the .odt (.tex) you can generate a
PDF. I would be surprised if it were possible to go back from .odt
(.tex) to the source .odt (.Rnw).

I would suggest that you contact the authors of the respective
packages to make sure that the functionality is (not) available.
Regards
Liviu

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-22 Thread Alexander Shenkin
Thanks Liviu,

I've looked into SWord, and while it's an impressive project, I'm
concerned that it doesn't quite give me the fine-grain control I'd like
over the R environment where it's being executed.  It's still in the
back of my mind though, and I may indeed go with it at some point.

If I understand it correctly, odfWeave doesn't have a path backwards
from the odf doc back to the original odfWeave doc (which is the main
restriction of all these Sweave/knitr/etc solutions in my use case). 
Please correct me if I'm wrong about that!

Thanks,
Allie

On 5/22/2012 4:36 AM, Liviu Andronic wrote:
> On Mon, May 21, 2012 at 10:29 PM, Alexander Shenkin  wrote:
>> 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?
>>
> Hmm, there are Sweave equivalents for LibreOffice [1] and MS Word [2].
> Have you looked into those? You may find other suggestions in the
> ReproducibleResearch Task View [3].
>
> Liviu
>
> [1] http://crantastic.org/packages/odfWeave
> [2] http://crantastic.org/packages/SWordInstaller
> [3] http://crantastic.org/task_views/ReproducibleResearch

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-22 Thread Liviu Andronic
On Mon, May 21, 2012 at 10:29 PM, Alexander Shenkin  wrote:
> 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?
>
Hmm, there are Sweave equivalents for LibreOffice [1] and MS Word [2].
Have you looked into those? You may find other suggestions in the
ReproducibleResearch Task View [3].

Liviu

[1] http://crantastic.org/packages/odfWeave
[2] http://crantastic.org/packages/SWordInstaller
[3] http://crantastic.org/task_views/ReproducibleResearch

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-21 Thread Alexander Shenkin
Thanks Michael - I think grid.table does the trick.

On 5/21/2012 3:33 PM, R. Michael Weylandt wrote:
> 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  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@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.

__
R-help@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.


Re: [R] sweave tables as images?

2012-05-21 Thread R. Michael Weylandt
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  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@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.

__
R-help@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.