Hello Lauri,
If you write "> methods(xtable)", xtable.stat.table is not included, thus it
must be included but I have not found howto...
But, if you use:
a.latex <- latexVerbatim(a)
Function latexVerbatim "executes the object's print method, capturing the
output for a file inside a LaTeX verbatim environment" (as says in the help).
While someone finds a better solution, I hope it can help you.
Cheers,
Albert
Albert Sanchez-Niubo
Drug abuse epidemiology
IMIM-Hospital del Mar
Parc de Recerca Biom?dica de Barcelona
c/ Doctor Aiguader, 88 | 08003 Barcelona
asanchez at imim.es
www.imim.es
Date: Fri, 30 May 2008 09:46:57 +0300
From: lauri.nikkinen at iki.fi
To: r-sig-epi at stat.math.ethz.ch
Subject: [R-sig-Epi] stat.table object into latex
R users,
Is there a way to convert stat.table (library(Epi)) object into latex
table? I have tried xtable from (xtable package) and latex (Hmisc
package) with no success.
Example code:
install.packages("Epi")
library(Epi)
install.packages("Hmisc")
library(Hmisc)
install.packages("xtable")
library(xtable)
a <- stat.table(index=list(wool,tension),
contents=list(count(),mean(breaks),percent (wool)),
data=warpbreaks)
a
a.latex <- xtable(a)
Error in UseMethod("xtable") : no applicable method for "xtable"
a.latex <- latex(a)
Error in x[, j] : incorrect number of dimensions
Best,
Lauri