assert_disjunct: Check if an argument is disjunct from a given set

assert_disjunctR Documentation

Check if an argument is disjunct from a given set

Description

Check if an argument is disjunct from a given set.

Usage

assert_disjunct(
  x,
  y,
  fmatch = FALSE,
  .var.name = checkmate::vname(x),
  comment = NULL,
  add = NULL
)

Arguments

x

[any]
Object to check.

y

[atomic]
Other set.

fmatch

[logical(1)]
Use the set operations implemented in fmatch in package fastmatch. If fastmatch is not installed, this silently falls back to match. fastmatch::fmatch modifies y by reference: A hash table is added as attribute which is used in subsequent calls.

.var.name

[character(1)]
Name of the checked object to print in error messages. Defaults to the heuristic implemented in vname.

comment

[character(1)]
Extra information to be appended to the standard error message in assertions.

add

[AssertCollection]
Collection to store assertions. See AssertCollection.

Details

The assertions are based on checkmate::checkDisjunct. NVIcheckmate::assert_disjunct differs from checkmate::assert_disjunct in including the argument comment = . The help is updated to reflect the changes.

Value

If the check is successful, the function assert_disjunct return x invisibly.
If the check is not successful, assert_disjunct throws an error message.


NorwegianVeterinaryInstitute/NVIcheckmate documentation built on Dec. 14, 2024, 10:43 p.m.