Description Usage Arguments Value Note See Also Examples
View source: R/is-special-string.R
Checks to see if he unput is a single character.
1 2 3 4 5 6 7 | 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
.
1 2 | x <- c("", "a", "aa", NA)
is_single_character(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.