detect_transmutation | R Documentation |
We rely on predictors to occur in models with only one type (such as numeric or factor), but the use of factor() would make it possible for a predictor to appear both as a factor or as numeric. The use of factor() also makes it harder to correctly detect the types of predictors, since the methods for obtaining model predictors provide them before they are converted to factor, not after. So we reject formulas that transmute types inside the formula, such as with factor().
detect_transmutation(formula, call = parent.frame())
formula |
Model formula |
call |
Environment in which to raise the error, defaulting to the calling environment. As this function is recursive, this reduces the complexity of backtraces. |
Presently only factor() calls are rejected, but if other transmutations (such as conversions to logical or numeric) prove to be problems, they can be rejected as well.
No value. Raises an error if transmutation is present.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.