checklist: Is a formula a check formula?

Description Usage Arguments Value See Also Examples

Description

is_check_formula(x) checks whether x is a check formula, while is_checklist(x) checks whether x is a checklist, i.e., a list of check formulae. (Neither function verifies logical consistency of the implied checks.)

Usage

1
2
3

Arguments

x

Object to test.

Value

is_check_formula, resp. is_checklist, returns TRUE or FALSE, according to whether x is or is not a check formula, resp. checklist.

See Also

firmly (on the specification and use of check formulae)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
is_check_formula(list(~x, ~y) ~ is.numeric)  # [1] TRUE
is_check_formula("Not positive" ~ {. > 0})   # [1] TRUE

is_checklist(list(list(~x, ~y) ~ is.numeric, "Not positive" ~ {. > 0}))
# [1] TRUE

# Invalid checklists
is_checklist("Not positive" ~ {. > 0})            # [1] FALSE (not a list)
is_checklist(list(is.numeric ~ list(~ x)))        # [1] FALSE (backwards)
is_checklist(list(list(log ~ x) ~ is.character))  # [1] FALSE (invalid check item)

egnha/valaddin documentation built on Oct. 6, 2017, 3:58 p.m.