check_augment_function: Check an augment method

Description Usage Arguments Value

View source: R/check_augment_function.R

Description

Call this function to perform tests. If a tests fails, an informative error will be thrown. Otherwise silent.

Test when strict = FALSE:

Additional tests when strict = TRUE:

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.

Usage

1
check_augment_function(aug, model, data = NULL, newdata = NULL, strict = TRUE)

Arguments

aug

An augment method. For example, augment.betareg.

model

A fit model object to call the augment method on.

data

A data frame or tibble to use when testing aug.

newdata

A dataset to use to check the newdata behavior, ideally distinct for the dataset used to check the data behavior.

strict

Logical indicating whether the strict version of tests should be used. Defaults to TRUE.

Value

An invisible NULL. This function should be called for side effects, not return values.


modeltests documentation built on Jan. 16, 2021, 5:38 p.m.