Description Usage Arguments Functions Examples
Tests for strings
1 2 3 |
x |
a character vector/string. |
is_nonempty_string
: Test that a character is both a string (character vector of length one)
and that it is non-empty, has at least one character and is not missing.
is_optional_string
: Check for an optional string: must be a character, not missing,
a vector of either length 0 or 1, and if provided must not be empty ("").
1 2 3 4 5 6 7 8 9 10 | # TRUE
is_nonempty_string("hello")
# All FALSE
x <- c("hello", "world")
is_nonempty_string(x)
is_nonempty_string(NA_character_)
is_nonempty_string(character(0))
is_nonempty_string(NULL)
is_nonempty_string(12345)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.