assertChoice: Assert that an object is within a certain oprtions.

View source: R/assert.R

assertChoiceR Documentation

Assert that an object is within a certain oprtions.

Description

Assert that an object is within a certain oprtions.

Usage

assertChoice(
  x,
  choices,
  length = NULL,
  na = FALSE,
  null = FALSE,
  unique = FALSE,
  named = FALSE,
  call = parent.frame(),
  msg = NULL
)

Arguments

x

Variable to check.

choices

Options that x is allowed to be.

length

Required length. If NULL length is not checked.

na

Whether it can contain NA values.

null

Whether it can be NULL.

unique

Whether it has to contain unique elements.

named

Whether it has to be named.

call

Call argument that will be passed to cli error message.

msg

Custom error message.


omopgenerics documentation built on Sept. 30, 2024, 9:16 a.m.