assert: Assert the class and length of an object

View source: R/assert.R

assertR Documentation

Assert the class and length of an object

Description

Assert the class and length of an object

Usage

assert(
  x,
  what,
  name = NULL,
  length_check = TRUE,
  length_req = NULL,
  stopOnFail = NULL
)

Arguments

x

an R object

what

(character) The class(es) that the object should be

name

(character) The name of the R object (used in error messages)

length_check

(logical) Whether to check if the object has length (Default: TRUE)

length_req

(numeric) The required length of x.

stopOnFail

Whether the function stops as soon as one of the check fails, or keep going to gather all error messages at once.


salix-d/salix_miscFuns documentation built on Aug. 14, 2024, 7:45 p.m.