named_logical_vector_to_check_result: Create a CheckResult from a named logical vector

Description Usage Arguments Value Examples

View source: R/checks.R

Description

This takes a named logical vector and turns it into a CheckResult object, using the names to create a message.

Usage

1

Arguments

vec

a named logical vector

header

the header for the message that will be created.

Value

a CheckResult object

Examples

1
2
3
4
5
6
7
8
9
vec <- c(a = TRUE, b = FALSE)
# test fails, and message includes "b" as the reason for failing
res <- CanonicalForms:::named_logical_vector_to_check_result(vec, "A test!")
print(res)
#> failed check
#>
#> Additional info:
#>   A test!
#>   x b

colin-fraser/CanonicalForms documentation built on Jan. 8, 2022, 8:42 a.m.