check_scalar: Check if Function Argument is Scalar
Description
A function to check that argument is of proper class and of
length 1.
Usage
check_scalar(..., arg_class, alt_null = FALSE)
Value
Invisible NULL
if assertion is TRUE
, otherwise an error message.
Arguments
- ...
Function argument that is being asserted.
- arg_class
Class name. Usually "character", "numeric",
"data.frame", etc.
- alt_null
Logical. Should argument accept NULL value.