View source: R/assert_character.R
assert_character | R Documentation |
Performs assertions if an argument is a vector of type character.
assert_character(
x,
n.chars = NULL,
min.chars = NULL,
max.chars = NULL,
pattern = NULL,
fixed = NULL,
ignore.case = FALSE,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
sorted = FALSE,
names = NULL,
null.ok = FALSE,
.var.name = checkmate::vname(x),
comment = NULL,
add = NULL
)
x |
[ |
n.chars |
[ |
min.chars |
[ |
max.chars |
[ |
pattern |
[ |
fixed |
[ |
ignore.case |
[ |
any.missing |
[ |
all.missing |
[ |
len |
[ |
min.len |
[ |
max.len |
[ |
unique |
[ |
sorted |
[ |
names |
[ |
null.ok |
[ |
.var.name |
[ |
comment |
[ |
add |
[ |
The assertions are based on checkmate::checkCharacter
. NVIcheckmate::assert_character
differs from checkmate::assert_character
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
.
If the check is successful, the function
assert_character
return x
invisibly.
If the check is not successful,
assert_character
throws an error message.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.