View source: R/helpfunctions.R
| get_groups | R Documentation |
A helper function that generates grouping information from a data.frame and a character vector with the names of grouping variables. In all cases, the level "lvlone" is added to indicate the lowest level of the data (i.e., each observation is its own group).
get_groups(idvars, data)
idvars |
a character vector with the names of grouping variables |
data |
a data.frame |
a list with grouping information for each grouping level:
each element is a vector of length nrow(data) with the group
membership indices of each observation for the corresponding
grouping level.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.