Skip to content
Prev 69696 / 398525 Next

Conflict between xtable and Hmisc when using Sweave?

Dear Frank,

I have a Sweave document in which I export anova (aov) tables to Latex 
and calculate some summary statistics with summarize{Hmisc} for a graph 
(as in the example below).

I currently use the following code for the aov tables:
<<results=tex>>=
   tmp <- datGrassHC[datGrassHC$Loc > 0 & datGrassHC$Loc < 9 ,]
   tmpAov <- aov(Height~Geology*Altitude*Origin*BinInOut , data=tmp)
   tmpTable <- xtable (tmpAov ,
     caption="ANOVA table for vegetation height.",
     label="tab:AnovaHeight"
     )
   print.xtable(tmpTable, type="latex", floating=TRUE,
     table.placement="ht", caption.placement="top",
     latex.environments=c("center"))
     )
@

I used xtables, because it has a working aov example. I would be happy 
to use an alternative if I knew how! Would you have sample code to 
illustrate how to export an aov table to Latex using latex{Hmisc}.

Thanks very much for your help,

Sander.
Frank E Harrell Jr wrote: