View source: R/integer_vector.R
is_non_negative_integer_vector | R Documentation |
Checks if the passed entity is a vector of non negative integers. Note that in R single values are also vectors.
is_non_negative_integer_vector(
value,
exact_length = NULL,
min_length = NULL,
max_length = NULL,
allow_na_values = FALSE
)
value |
The value to check |
exact_length |
integer. If passed, checks if the vector is of the *exact* specified length. |
min_length |
integer. If passed, checks if the vector length is at least the specified length, inclusive. Note: if exact_length is specified, this parameter is ignored |
max_length |
integer. If passed, checks if the vector length is at most the specified length, inclusive Note: if exact_length is specified, this parameter is ignored |
allow_na_values |
boolean: If passed allows vectors containing NAs. The length check is performed including the NA values. Default FALSE. |
## Not run:
# For assertion
assertthat::assert_that(
qscheck::is_non_negative_integer_vector(my_parameter)
)
# For check
if (qscheck::is_non_negative_integer_vector(my_parameter)) {}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.