powered by
R's formula notation allows models with no intercept and no predictors. These require special handling internally. is.empty.model() checks whether an object describes an empty model.
is.empty.model()
is.empty.model(x)
A terms object or an object with a terms method.
terms
TRUE if the model is empty
TRUE
lm, glm
lm
glm
# NOT RUN { y <- rnorm(20) is.empty.model(y ~ 0) is.empty.model(y ~ -1) is.empty.model(lm(y ~ 0)) # }
Run the code above in your browser using DataLab