Skip to contents

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.