| check_pos_integer_scalar | R Documentation |
Check positive integer scalar
check_pos_integer_scalar(x, arg_name = deparse(substitute(x)))
x |
Numeric: Value to check. Must be a single non-NA whole number greater than zero. |
arg_name |
Character: Argument name to use in error messages. |
Accepts any single numeric value that is a whole number strictly greater than zero.
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_pos_integer_scalar(1L)
check_pos_integer_scalar(10)
# Throw error:
try(check_pos_integer_scalar(0))
try(check_pos_integer_scalar(-1L))
try(check_pos_integer_scalar(1.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.