“Null formula” of a model
null_formula.Rd
Returns the formula of an intercept-only model (. ~ 1
) if the original formula x
contains an intercept
and the constant zero-model formula (. ~ 0
) otherwise.
See also
Used as default value of argument “formula1” in stepwise functions.
Examples
null_formula(lm(Sepal.Length ~ ., iris))
#> Sepal.Length ~ 1
#> <environment: 0x56188cb03e98>