assert_all_are_single_characters {assertive.strings} | R Documentation |
Checks to see if he unput is a single character.
assert_all_are_single_characters(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop")) assert_any_are_single_characters(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop")) is_single_character(x, .xname)
x |
A character vector. |
na_ignore |
A logical value. If |
severity |
How severe should the consequences of the assertion be?
Either |
.xname |
Not intended to be used directly. |
is_single_character
returns TRUE
when the input is a
single character (as determined by nchar
; this excludes NA
).
The assert_*
functions return nothing but throw an error if the
corresponding is_*
function returns FALSE
.
The behaviour of this function has changed so that NA
inputs
now return NA
rather than FALSE
.
x <- c("", "a", "aa", NA) is_single_character(x)