Verify that the dataset has the required variables for the algorithm.
Source:R/verify-variables.R
verify_required_variables.Rd
Use this function inside another function within an if
condition to provide an
informative error message within the function used. This is done to make the
error message more informative to the location that the error actually
occurs, rather than within this function.
Usage
verify_required_variables(data, register, call = rlang::caller_env())
Arguments
- data
The dataset to check.
- register
The abbreviation of the register name. See list of abbreviations in
get_register_abbrev()
.- call
The environment where the function is called, so that the error traceback gives a more meaningful location.