stopIfNotIn: Stop with Info If Element Is Not in Expected Set

View source: R/utils_berlin.R

stopIfNotInR Documentation

Stop with Info If Element Is Not in Expected Set

Description

Stop with info message if element is not in expected set of elements

Usage

stopIfNotIn(
  element,
  elements,
  singular = "option",
  plural = paste0(singular, "s"),
  do_stop = TRUE
)

Arguments

element

element to be looked for in elements

elements

vector of possible elements

singular

name of object to appear in error message. Default: "option"

plural

name of object (plural) to appear in error message. Default: paste0(singular, "s")

do_stop

if FALSE (the default is TRUE) program execution does not stop. Instead a message is shown.


KWB-R/kwb.prep documentation built on June 11, 2022, 1:29 p.m.