Test if a Model's Formula is Empty (original) (raw)

is.empty.model {stats} R Documentation

Description

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.

Usage

is.empty.model(x)

Arguments

x A terms object or an object with a terms method.

Value

TRUE if the model is empty

See Also

[lm](../../stats/help/lm.html), [glm](../../stats/help/glm.html)

Examples

y <- rnorm(20)
is.empty.model(y ~ 0)
is.empty.model(y ~ -1)
is.empty.model(lm(y ~ 0))

[Package _stats_ version 4.6.0 Index]