run_check: Run check

View source: R/check.R

run_checkR Documentation

Run check

Description

A check is usually a function that takes one argument and returns a pass or fail value. There are a few types which are recognized as pass or fail.

  • logical values TRUE and FALSE which are recognized as pass and fail, respectively

  • chex::PASS or the result of calling PASS() with a reason

  • likewise for chex::FAIL

  • A result object created by result()

Usage

run_check(check, x)

Arguments

check

a object used to check the value of x

x

an object to check

Details

In addition to functions, checks can also be one of the following:

  • logical values, which get converted to pass or fail values directly

  • formulas, which get converted into check functions using rlang::as_function()

  • custom R objects with a method for run_check which returns one of the valid pass/fail values mentioned above


shunsambongi/chex documentation built on Aug. 21, 2022, 5:19 a.m.