perctable
and proptable
use the cross-classifying factors to build a
contingency table of the percents or proportions at each combination of factor levels.perctable(...)proptable(...)
table
; typically
one or more objects which can be interpreted as factors (including character strings),
or a list (or data frame) whose components can be so interpreted.table
.perctable(rbinom(1000,10,.5))
with(airquality,
perctable(OzHi=Ozone > 80, Month, useNA="ifany"))
with(airquality,
perctable(OzHi=Ozone > 80, Month, useNA="always"))
Run the code above in your browser using DataLab