Skip to content

Cross classification table with tally()? #805

@mlaviolet

Description

@mlaviolet

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

Created on 2024-02-23 with reprex v2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions