data_group | R Documentation |
This function is comparable to dplyr::group_by()
, but just
following the datawizard function design. data_ungroup()
removes the
grouping information from a grouped data frame.
data_group(
data,
select = NULL,
exclude = NULL,
ignore_case = FALSE,
regex = FALSE,
verbose = TRUE,
...
)
data_ungroup(data, verbose = TRUE, ...)
data |
A data frame |
select |
Variables that will be included when performing the required tasks. Can be either
If |
exclude |
See |
ignore_case |
Logical, if |
regex |
Logical, if |
verbose |
Toggle warnings. |
... |
Arguments passed down to other functions. Mostly not used yet. |
A grouped data frame, i.e. a data frame with additional information about the grouping structure saved as attributes.
data(efc)
suppressPackageStartupMessages(library(poorman, quietly = TRUE))
# total mean
efc %>%
summarize(mean_hours = mean(c12hour, na.rm = TRUE))
# mean by educational level
efc %>%
data_group(c172code) %>%
summarize(mean_hours = mean(c12hour, na.rm = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.