Description Usage Arguments Value See Also Examples
View source: R/is-empty-model.R
Checks to see if the input is the empty model.
1 2 3 4 5 6 7 8 9 | assert_is_empty_model(x, severity = getOption("assertive.severity",
"stop"))
assert_is_non_empty_model(x, severity = getOption("assertive.severity",
"stop"))
is_empty_model(x, .xname = get_name_in_parent(x))
is_non_empty_model(x, .xname = get_name_in_parent(x))
|
x |
Input to check. |
severity |
How severe should the consequences of the assertion be?
Either |
.xname |
Not intended to be used directly. |
is_[non_]empty_model
returns TRUE
if the input is an
[non] empty model. (has_terms
is used to determine that a variable
is a model object.) The model is considered empty if there are no
factors and no intercept. The assert_*
functions return nothing
but throw an error if the corresponding is_*
function returns
FALSE
.
is.empty.model
and is_empty
.
1 2 3 4 5 6 7 8 9 10 | # empty models have no intercept and no factors
an_empty_model <- lm(uptake ~ 0, CO2)
is_empty_model(an_empty_model)
a_model_with_an_intercept <- lm(uptake ~ 1, CO2)
a_model_with_factors <- lm(uptake ~ conc * Type, CO2)
is_non_empty_model(a_model_with_an_intercept)
is_non_empty_model(a_model_with_factors)
assertive.base::dont_stop(assert_is_empty_model(a_model_with_factors))
|
[1] TRUE
[1] TRUE
[1] TRUE
$`assert_is_empty_model(a_model_with_factors)`
<assertionError: is_empty_model : a_model_with_factors has factors conc, Type, conc:Type.>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.