number_of_strata: Count number of groups across a set of variables in a data...

View source: R/internal-number_of_groups.R

number_of_strataR Documentation

Count number of groups across a set of variables in a data frame

Description

Counts number of groups across specified grouping and stratification variables in a data frame. At least one grouping or stratification variable must be provided.

Usage

number_of_strata(df, stratify_by)

Arguments

df

A data frame with grouping and/or stratification variables.

stratify_by

Variables in data frame that defines a stratification of the data.

Value

Number of distinct strata in the data frame.


MAPCtools documentation built on June 25, 2025, 5:09 p.m.