get_groups: Get grouping information

View source: R/helpfunctions.R

get_groupsR Documentation

Get grouping information

Description

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).

Usage

get_groups(idvars, data)

Arguments

idvars

a character vector with the names of grouping variables

data

a data.frame

Value

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.


JointAI documentation built on Jan. 30, 2026, 5:07 p.m.