| check_integer_scalar | R Documentation |
Check integer scalar
check_integer_scalar(x, arg_name = deparse(substitute(x)))
x |
Numeric: Value to check. Must be a single non-NA whole number. |
arg_name |
Character: Argument name to use in error messages. |
Accepts any single numeric value that is a whole number. Integer-typed inputs (1L) and
double-typed whole numbers (1, 100) are both accepted for user convenience.
Called for side effects. Throws an error if checks fail.
EDG
check_integer_scalar(5L)
check_integer_scalar(100)
# Throw error:
try(check_integer_scalar(1.5))
try(check_integer_scalar(NA_integer_))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.