When calling lmitt.lm, we evaluate the lm object's data call in eval_env. This usually won't work if someone has created a function where they pass a generic data argument to lmitt.lm:
> lmitt_wrapper <- function(form, design, model_data) {
+ return(lmitt(lm(form, data = model_data), design = design))
+ }
> y <- lmitt_wrapper(y ~ z.(des), des, simdata)
Error in eval(lm_model$call$data, envir = eval_env) :
object 'model_data' not found
It will only work if someone were to pass a the model_data argument a dataframe named model_data. I propose we use an approach similar to fallback_data_search, but instead use eval rather than get to ensure that any subsetting, rbinding, or cbinding is properly accounted for. I've linked a PR with my propsed changes.
When calling
lmitt.lm
, we evaluate thelm
object's data call ineval_env
. This usually won't work if someone has created a function where they pass a generic data argument tolmitt.lm
:It will only work if someone were to pass a the
model_data
argument a dataframe namedmodel_data
. I propose we use an approach similar tofallback_data_search
, but instead useeval
rather thanget
to ensure that any subsetting,rbind
ing, orcbind
ing is properly accounted for. I've linked a PR with my propsed changes.