drop_levels: Check for empty factor levels

View source: R/helpfunctions_checks.R

drop_levelsR Documentation

Check for empty factor levels

Description

CHECKS if there are empty factor levels in any of the variables used in the model.

Usage

drop_levels(data, allvars, warn = TRUE, mess = NULL)

Arguments

data

a data.frame

allvars

a character vector (of all variable names used in the model)

warn

logical, if TRUE warnings are printed

Value

the data.frame (unchanged)

Note

Originally, the function also dropped these levels. Then, I (accidentally?) had commented out a line so that no check was performed. Now, only create a warning if there are empty levels, but do not drop them.

used in model_imp (2020-06-09)


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