[R] ftable as latex (with Hmisc?)
    Dieter Menne 
    dieter.menne at menne-biomed.de
       
    Mon Nov 26 15:44:27 CET 2007
    
    
  
Dear List, possibly called Frank,
I tried to create an ftable lookalike of the following data set in LaTeX/Sweave
with summary(formula,..), but I could not get it to work for count tables; 
numeric tables work fine. 
summary(formula,...,fun="table") does not give the full cross breakdown.
Other suggestions welcome. Note that in the output there should be empty fields
on repeated column values like ftable produces.
Dieter
#---------------------------------------
library(Hmisc)
df = data.frame(drug=sample(c("P","V"),100,TRUE),
                Hist1=sample(c("Pos","Neg"),100,TRUE),
                Hist2=sample(c("Pos","Neg"),100,TRUE))
ftable(drug~Hist1+Hist2,data=df)
    
    
More information about the R-help
mailing list