h_add_sanity_check {sanityTracker}R Documentation

Wrapper for add_sanity_check for internal use

Description

The convenience function usually provide some defaults like description that can be overwritten by the user through the ... argument of the convenience function. This function manages to set those values that were NOT overwritten by the user through the ... argument and then call add_sanity_check.

Usage

h_add_sanity_check(
  ellipsis,
  fail_vec,
  .generated_desc,
  data,
  data_name = "",
  param_name = "",
  call = h_deparsed_sys_call(which = -2),
  .fail_vec_str = checkmate::vname(x = fail_vec)
)

Arguments

ellipsis

usually list(...) of the function that calls this function. It contains the parameters defined by the user for add_sanity_check.

fail_vec

logical vector where TRUE indicates that a fail has happend

.generated_desc

will be passed to .add_sanity_check if ellipsis does not contain a element with name 'description'

data

will be passed to .add_sanity_check if ellipsis does not contain a element with name 'data'

data_name

will be passed to .add_sanity_check if ellipsis does not contain a element with name 'data_name'

param_name

will be passed to .add_sanity_check if ellipsis does not contain a element with name 'param_name'

call

will be passed to .add_sanity_check if ellipsis does not contain a element with name 'call'

.fail_vec_str

usually not used by the user. Captures what was passed to fail_vec.

Value

see return value of add_sanity_check

Examples

d <- data.frame(type = letters[1:4], nmb = 1:4)
# h_add_sanity_check is used on sc_col_elements()
sc_col_elements(object = d, col = "type", feasible_elements = letters[2:4])
get_sanity_checks()

[Package sanityTracker version 0.1.0 Index]