Missing levels can cause unexpected behavior when fitting a model after setting contrasts. This function removes missing levels and informs the user of how many levels were dropped from each factor.
.droplevels_as_needed(model_data, lhs_variables, verbose = TRUE)model_data where existing factor columns have had any missing levels removed
Model data
variables specified for contrast coding from formulas
Should messages be sent? Defaults to TRUE