Learn R Programming

assertive (version 0.2-1)

assert_all_are_single_characters: Is the input a single character?

Description

Checks to see if he unput is a single character.

Usage

assert_all_are_single_characters(x)

assert_any_are_single_characters(x)

is_single_character(x)

Arguments

x
A character vector.

Value

  • 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.

See Also

nchar

Examples

Run this code
x <- c("", "a", "aa", NA)
is_single_character(x)

Run the code above in your browser using DataLab