Learn R Programming

socialmixr (version 0.7.0)

abort_if_missing: Abort if grouping columns are absent from a list of available columns

Description

Internal helper used by check_grouping_columns() to validate one side (participant or contact) of a survey against a list of groupings. Builds a single cli::cli_abort() listing every column that is missing and, if the missing set includes the "age" grouping, hints at calling assign_age_groups().

Usage

abort_if_missing(groupings, available_cols, key, side)

Value

invisibly NULL on success; otherwise raises a cli error

Arguments

groupings

a list of grouping triples as returned by resolve_groupings()

available_cols

character vector of column names that are present

key

either "part" or "cnt", the slot of each grouping to check against available_cols

side

label inserted into the error message describing which side of the survey was checked (e.g. "participant data")