Function for checking if an object is of a specific type or class.
Usage
check_class_and_type(
object,
object_name = NULL,
type_classes = "bool",
allow_NULL = FALSE,
min = NULL,
max = NULL,
allowed_values = NULL
)
Arguments
- object
Any R object.
- object_name
string
Name of the object. This is helpful for debugging.- type_classes
vector
ofstring
s containing the type or classes which the object should belong to.- allow_NULL
bool
IfTRUE
allow the object to beNULL
.- min
double
orint
Minimal value for the object.- max
double
orint
Maximal value for the object.- allowed_values
vector
ofstring
s determining the allowed values. If all strings are allowed set this argument toNULL
.
Note
parameter min
, max
, and allowed_values
do not apply if type_classes
is a class.
allowed_values does only apply if type_classes
is string
.
See also
Other Utils Checks Developers:
check_all_args()