Description Usage Arguments Value Examples
View source: R/check_num_int.R
Match variable class with one of numeric or integer and abort by 'abort' otherwise.
1 | check_num_int(var, n = NULL, allowNULL = FALSE)
|
var |
variable to check |
n |
numeric to also check length var |
allowNULL |
allow to pass check if var NULL? FALSE by default |
silent if check is passed, rlang error otherwise
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | id <- 2
check_num_int(id)
id <- 2L
check_num_int(id)
# check variable type and length
check_num_int(id, n = 1)
# pass check if variable NULL
id <- NULL
check_num_int(id, allowNULL = TRUE)
## Not run:
# generates error
id <- "2"
check_num_int(id)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.