Mutates data frame so that summary tables give totals
totals.Rd
This function uses stata_expand
and dplyr::mutate
to give
a data frame that, when summarised, with give total rows and/or
columns.
Examples
df <- totals(mtcars, cyl)
dplyr::count(df)
#> n
#> 1 64