Adds row and column sums to a two-way table.

mar_table(x)

Arguments

x

a two-way table.

Value

A table with row and column totals added.

Author

David Meyer David.Meyer@R-project.org

Examples

data("SexualFun")
mar_table(SexualFun)
#>               Wife
#> Husband        Never Fun Fairly Often Very Often Always fun TOTAL
#>   Never Fun            7            7          2          3    19
#>   Fairly Often         2            8          3          7    20
#>   Very Often           1            5          4          9    19
#>   Always fun           2            8          9         14    33
#>   TOTAL               12           28         18         33    91