getGroups.glmmTMB: Extract Grouping Factors from an Object

getGroups.glmmTMBR Documentation

Extract Grouping Factors from an Object

Description

This (simplified) method for getGroups extracts the grouping factor for a specified level of the random effects structure in a glmmTMB object.

Usage

## S3 method for class 'glmmTMB'
getGroups(object, form = formula(object), level, data, sep = "/", ...)

Arguments

object

a fitted glmmTMB object.

form

ignored (included for compatibility).

level

integer indicating the level of the random effects structure to extract, defaults to 1 if missing.

data

ignored (included for compatibility).

sep

ignored (included for compatibility).

...

additional arguments (not used).

Value

A factor representing the grouping structure at the specified level, with a group attribute indicating the name of the grouping factor.

Examples

model <- glmmTMB(count ~ mined + (1 | spp), data = Salamanders, family = nbinom1)
getGroups(model)

glmmTMB documentation built on Jan. 15, 2026, 9:07 a.m.