check_pass: Create custom conditions for reporting

Description Usage Arguments Value Examples

View source: R/conditions.R

Description

These functions create custom condition objects with subclasses "check_pass", "check_warn", and "check_fail" (inheriting from "message", "warning", or "error", respectively). Validation functions such as dccvalidator::check_col_names() use these to report results and provide additional data on the source of errors or invalid data if needed.

Usage

1
2
3
4
5
check_pass(msg, behavior, data = NULL)

check_warn(msg, behavior, data = NULL)

check_fail(msg, behavior, data = NULL)

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)

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
check_pass(msg = "Success!", behavior = "Files should be complete")
check_warn(
  msg = "Warning, some data is missing",
  behavior = "Files should be complete",
  data = c("specimenID", "assay") # columns with missing data
)
check_fail(
  msg = "Error, some required data is missing",
  behavior = "Files should be complete",
  data = c("specimenID", "assay") # columns with missing data
)

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