Learn R Programming

Ecfun (version 0.3-2)

nchar0: Zero characters or NULL

Description

Returns TRUE if (is.null(x) || (length(x) == 0) || (max(nchar(x)) == 0)).

Usage

nchar0(x, ...)

Value

TRUE if x is either

NULL or max(nchar(x))

== 0. FALSE otherwise.

Arguments

x

a character vector or something that can be coerced to mode character

...

optional arguments to be passed to nchar

Author

Spencer Graves

See Also

Examples

Run this code
stopifnot(
all.equal(nchar0(NULL), TRUE)
)

stopifnot(
all.equal(nchar0(character(0)), TRUE)
)

stopifnot(
all.equal(nchar0(character(3)), TRUE)
)

stopifnot(
all.equal(nchar0(c('a', 'c')), FALSE)
)

Run the code above in your browser using DataLab