assert_integer | R Documentation |
Check if an argument is vector of type integer.
assert_integer(
x,
lower = -Inf,
upper = Inf,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
sorted = FALSE,
names = NULL,
typed.missing = FALSE,
null.ok = FALSE,
.var.name = checkmate::vname(x),
comment = NULL,
add = NULL
)
x |
[ |
lower |
[ |
upper |
[ |
any.missing |
[ |
all.missing |
[ |
len |
[ |
min.len |
[ |
max.len |
[ |
unique |
[ |
sorted |
[ |
names |
[ |
typed.missing |
[ |
null.ok |
[ |
.var.name |
[ |
comment |
[ |
add |
[ |
The assertions are based on checkmate::checkInteger
. NVIcheckmate::assert_integer
differs from checkmate::assert_integer
in including the argument comment =
. The help
is updated to reflect the changes.
This function does not distinguish between
NA
, NA_integer_
, NA_real_
, NA_complex_
NA_character_
and NaN
.
Depending on the function prefix:
If the check is successful, the function
assert_Integer
return x
invisibly, whereas
check_Integer
return TRUE
.
If the check is not successful,
assert_Integer
throws an error message and
check_Integer
returns a string with the error message.
If the check is successful, the function
assert_integer
return x
invisibly.
If the check is not successful,
assert_integer
throws an error message.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.