Create a condition of the given type

check_condition(msg, behavior, data, type)

Arguments

msg

Message to report

behavior

Statement of the correct behavior (i.e. what the higher level function was checking for)

data

Data to return (e.g. invalid values that need attention)

type

One of "check_pass", "check_warn", "check_fail"

Value

An S3 object of class "check_pass", "check_warn", or "check_fail"

Examples

strict <- TRUE check_condition( msg = "Some data is missing", behavior = "Files should be complete", data = c("specimenID", "assay"), type = ifelse(strict, "check_fail", "check_warn") )
#> <error/check_fail> #> Some data is missing