[R] How to combine xtable and minipage with Sweave ?

Dieter Menne dieter.menne at menne-biomed.de
Fri Mar 13 12:26:36 CET 2009


Ptit_Bleu <ptit_bleu <at> yahoo.fr> writes:

> I'm trying to put a dynamic table and a dynamic graph side by side in a pdf
> document using Sweave.
> The data.frame used to generate the table is called rg (rg.txt):
> 
> "Date"; "Code"; "Data1"; "Data2"
> "2009-03-10";"1";1958;147
> "2009-03-10";"2";302;144
...
> The Sweave script to test, saved as test_minipage_sweave.rnw, is the
> following one (I'm a newbie in Latex and R so I pasted some commands I found
> here and there) :
> 
1) There were typos in your code. It should be

  print(xtable(rg), include.rownames=F)

and it should be results=tex, not TEX

2) <<>> must start at column 0, this is the first error

3) Check about the rules of minipage and floats. See the sequence
for the figure in the tex code; this gives the typical "Not in outer
mode" error

Dieter




More information about the R-help mailing list