You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a is not in the data frame passed to model.frame, but annoyingly R will go find it in the global environment and paste it in anyway.
This causes problems because users might save a covariate to the global environment, then add it to obsCovs or yearlySiteCovs and then try to reference it in a formula for say, lambda. Instead of an error indicating the covariate is not available in siteCovs, R will find it in the global environment. Sometimes you get a dimension error and sometimes it works, silently giving you potentially nonsense results.
There is no way to force model.frame not to do this, so we'd have to either control the environment explicitly or just insert a manual check before the call to model.frame to make sure all elements of the formula exist in the data frame e.g.
a
is not in the data frame passed tomodel.frame
, but annoyingly R will go find it in the global environment and paste it in anyway.This causes problems because users might save a covariate to the global environment, then add it to
obsCovs
oryearlySiteCovs
and then try to reference it in a formula for say, lambda. Instead of an error indicating the covariate is not available insiteCovs
, R will find it in the global environment. Sometimes you get a dimension error and sometimes it works, silently giving you potentially nonsense results.There is no way to force
model.frame
not to do this, so we'd have to either control the environment explicitly or just insert a manual check before the call tomodel.frame
to make sure all elements of the formula exist in the data frame e.g.This is quite annoying though because we have to change it in every one of the many places we use
model.frame
.The text was updated successfully, but these errors were encountered: