Checks if x is a negative int (non-missing integer scalar with no attributes including names).
Usage
check_neg_int(x, coerce = FALSE, x_name = substitute(x), error = TRUE)
Arguments
- x
The object to check.
- coerce
A flag indicating whether to coerce a numeric (dbl) whole number to an int and drop attributes including names.
- x_name
A string of the name of the object x.
- error
A flag indicating whether to throw an informative error or immediately generate an informative message if the check fails.