Closed tsostarics closed 5 months ago
Implemented as follows:
When an object of class formula is detected:
> enlist_contrasts(cyl ~ 2)
Error in enlist_contrasts(cyl ~ 2) :
Formula passed to model_data, did you forget to pass a data frame?
When any other object that does not inherit data.frame
is detected:
Error in enlist_contrasts(matrix(c(1, 1, 1, 1), nrow = 2)) :
model_data should inherit class data.frame.
Instead found class(es): matrix, array
If you forget to pipe in the model data like so
The error message is
because the first formula is treated as
model_data
. Similarly for when only one formula is provided:There should be a type check on model_data to ensure it's not a formula, with an error message telling the user to check that they provided
model_data
correctly.