View source: R/check_augment_function.R
check_augment_function | R Documentation |
Call this function to perform tests. If a tests fails, an informative error will be thrown. Otherwise silent.
Test when strict = FALSE
:
aug(model, data = data)
passes check_tibble()
aug(model, newdata = newdata)
passes check_tibble()
Additional tests when strict = TRUE
:
aug(model, data = data)
passes check_augment_data_specification()
.
aug(model, newdata = newdata)
passes check_augment_data_specification()
.
aug(model, newdata = newdata)
passes check_augment_data_specification()
with add_missing = TRUE
.
If aug
has a newdata
argument, the newdata
argument takes precedence
over a data
argument, i.e. calls check_augment_newdata_precedence()
.
aug
either gives an informative error or produces a reasonable tibble,
i.e. calls check_augment_no_data()
.
Note that it doesn't make sense to test that aug(model, data = data)
passes check_augment_data_specification()
with add_missing = TRUE
. This is
because the user is already guaranteeing that data
is the original dataset
used to create model
.
check_augment_function(aug, model, data = NULL, newdata = NULL, strict = TRUE)
aug |
An augment method. For example, |
model |
A fit model object to call the augment method on. |
data |
A data frame or tibble to use when testing |
newdata |
A dataset to use to check the |
strict |
Logical indicating whether the strict version of tests should be used. Defaults
to |
An invisible NULL
. This function should be called for side effects, not return values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.