Some models literally retain copies of data frames etc in order to make predictions. This can be convenient but has at least two downsides (described below). This issue proposes that, in cases where such info is not needed, models that store data by default have this information removed from the fitted model. E.g., by default, lm should set the arg model = FALSE (and look into all model, x, y).
Downsides to default case of keeping original data.frame
Given that twidlr requires a data frame for predict, if the only reason this info is retained is to call predict, then it can be dropped.
It is inconsistent between models and thus misleading. For example, lm stores the original data by default making predict work properly. However, other models do not, and point to the original data frame in the global environment. E.g., see examples here. A similar thing can be done when lm is used with model = FALSE.
Some models literally retain copies of data frames etc in order to make predictions. This can be convenient but has at least two downsides (described below). This issue proposes that, in cases where such info is not needed, models that store data by default have this information removed from the fitted model. E.g., by default,
lm
should set the argmodel = FALSE
(and look into allmodel
,x
,y
).Downsides to default case of keeping original data.frame
lm
:Given that twidlr requires a data frame for
predict
, if the only reason this info is retained is to callpredict
, then it can be dropped.lm
stores the original data by default makingpredict
work properly. However, other models do not, and point to the original data frame in the global environment. E.g., see examples here. A similar thing can be done whenlm
is used withmodel = FALSE
.