Skip to contents

Assert that all elements of a vector are non-negative

Usage

assert_elements_non_neg(
  x,
  arg = "x",
  call = rlang::caller_env(),
  add_err_msg = ""
)

Arguments

x

vector of arguments to check for negativity

arg

string to print the name of the element your checking

call

Calling environment to be passed to cli::cli_abort() for traceback.

add_err_msg

string containing an additional error message, default is the empty string ("")

Value

NULL, invisibly