Description Usage Arguments Examples
This function takes a data frame, subsets it according to the levels of one or more variables, and returns a data frame containing the results computed on each subset, in addition to results computed on aggregate groups. See ddply for more details. See also DTplyWithTotals.
1 2 | ddplyWithTotals(.data, .variables, .fun = NULL, nestedOnly = FALSE,
grandTotal = FALSE)
|
.data |
Data frame to subset. |
.variables |
Vector of character strings or formula denoting variables to split on. |
.fun |
A function that returns a data frame, to be computed on each subset. |
nestedOnly |
Logical. Compute subtotals only for nested groups. |
grandTotal |
Logical. Compute the grand total. |
1 | ddplyWithTotals(mtcars, ~cyl + gear, function(df) data.frame(mean = mean(df$wt)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.