This function verifies that all variables specified in the formula are present in the provided data frame. If any variables are missing, the function will stop and return an error message listing the missing variables.
check_formula(formula, data)Invisibly returns NULL if all variables are present. Stops with an error if any variables are missing.
Formula. The model formula that specifies the relationship between the dependent and independent variables.
Data frame. The data frame in which to check for the presence of variables specified in the formula.