check_predefined_objects: Test predefined R objects

View source: R/check-predefined-objects.R

check_predefined_objectsR Documentation

Test predefined R objects

Description

At the start of your SCT, you typically want to check whether some predefined variables are still correct. test_predefined_object allows you to specify a vector of object names, together with a vector of equivalence conditions, evaluation specifications, undefined an incorrect messages.

Usage

check_predefined_objects(state, name, eq_condition = "equivalent",
  eval = TRUE, undefined_msg = NULL, incorrect_msg = NULL)

Arguments

state

the state to start from

name

vector of names of the objects to check

eq_condition

character vector indicating how to compare. See is_equal.

eval

logical vector indicating whether or not you want to check only the objects' existence or also whether their values match the solution.

undefined_msg

vector version of undefined_msg of check_object

incorrect_msg

vector version of incorrect_msg of check_object

Examples

## Not run: 
# Suppose the sample code specifies the variables a, b and c,
# and you want to check that a, b and c haven't changed.
ex() %>% check_predefined_objects(c("a", "b", "c"))

## End(Not run)


Data-Camp/testwhat documentation built on June 24, 2022, 9:59 p.m.