Description Usage Arguments Value See Also Examples
A version of dplyr's summarise function that provides an additional total row.
1 | summarise_total(df, label = "Total", ...)
|
df |
A grouped date.frame. |
label |
The label to use in the grouping columns of the 'Total' row. Defaults to 'Total'. |
... |
Name-value pairs of summary functions, as for dplyr:summarise. The name will be the name of the variable in the result. The value should be an expression that returns a single value like min(x), n(), or sum(is.na(y)). |
A data.frame containing a row of summary statistics for each group, plus a 'Total' row.
summarise
1 2 | iris %>% group_by(Species) %>% summarise(n = n(), `Mean Sepal Length` = mean(Sepal.Length))
iris %>% group_by(Species) %>% summarise_total(n = n(), `Mean Sepal Length` = mean(Sepal.Length))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.