totals | R Documentation |
This function uses stata_expand
and dplyr::mutate
to give
a data frame that, when summarised, with give total rows and/or
columns.
totals(df = ., ..., name = "Total")
df |
A data frame |
... |
one or two columns for which we require totals |
name |
Character string for the name of the total row/column |
df <- totals(mtcars, cyl)
dplyr::count(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.