check_condition: Create a condition of the given type

Description Usage Arguments Value Examples

View source: R/conditions.R

Description

Create a condition of the given type

Usage

1
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

1
2
3
4
5
6
7
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")
)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.