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.

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

if (FALSE) { # 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")) }