h_add_sanity_check: Wrapper for add_sanity_check for internal use

Description Usage Arguments Value Examples

View source: R/helper.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
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()

sanityTracker documentation built on April 22, 2020, 5:09 p.m.