在下表中,名为“百分比”的列显示了总列百分比。我如何让它在“vs”的每个级别中显示每个“am”级别的列百分比?
这就是我所拥有的:
这就是我要找的:
针织块如下:
<<echo=FALSE,results='asis'>>=
#
# library(tables)
# library(Hmisc)
# library(Formula)
## This gives me column percentages for the total table.
latex( tabular( Factor(vs)*Factor(am) ~ gear*Percent("col"), data=mtcars ) )
## I am trying to get column percentages for each level of "vs"
@