The margins argument to tally() currently supports only column margins, as far as I can tell. It would be useful to expand it to construct a complete cross classification table, perhaps with options "row", "column", or "both". Using 'gmodels::CrossTable()` adds complexity. Thanks!
library(mosaic)
tally(homeless ~ sex, data = HELPrct, margins = TRUE)
#> sex
#> homeless female male
#> homeless 40 169
#> housed 67 177
#> Total 107 346
The
margins
argument totally()
currently supports only column margins, as far as I can tell. It would be useful to expand it to construct a complete cross classification table, perhaps with options "row", "column", or "both". Using 'gmodels::CrossTable()` adds complexity. Thanks!Created on 2024-02-23 with reprex v2.1.0