check_subset2: Check subset2

Description Usage Arguments Value

View source: R/checkmate.R View source: R/checkmate.R

Description

The only different from checkmate::checkSubset is that this only print mismatches in x.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
check_subset2(x, choices, empty.ok = TRUE, fmatch = FALSE)

assert_subset2(
  x,
  choices,
  empty.ok = TRUE,
  fmatch = FALSE,
  .var.name = checkmate::vname(x),
  add = NULL
)

test_subset2(x, choices, empty.ok = TRUE, fmatch = FALSE)

expect_subset2(
  x,
  choices,
  empty.ok = TRUE,
  fmatch = FALSE,
  info = NULL,
  label = vname(x)
)

Arguments

x

[any]
Object to check.

choices

[atomic]
Set of possible values. May be empty.

empty.ok

[logical(1)]
Treat zero-length x as subset of any set choices (this includes NULL)? Default is TRUE.

fmatch

[logical(1)]
Use the set operations implemented in fmatch in package fastmatch. If fastmatch is not installed, this silently falls back to match. 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 assertions. Defaults to the heuristic implemented in vname.

add

checkmate::AssertCollection
Collection to store assertions. See checkmate::AssertCollection.

info

[character(1)]
Extra information to be included in the message for the testthat reporter. See expect_that.

label

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

Value

(logical(1)).


dymium-org/dymiumCore documentation built on July 18, 2021, 5:10 p.m.