strRemoveEmpty: Remove empty strings

View source: R/strRemoveEmpty.R

strRemoveEmptyR Documentation

Remove empty strings

Description

Remove empty strings

Usage

strRemoveEmpty(x, naOk = TRUE, spacesOk = TRUE)

Arguments

x

character. Character vector.

naOk

logical(1). Allow NA values to propagate.

spacesOk

logical(1). Consider spaces to be non-empty.

Value

character. Modified vector, with empty strings removed.

Note

Updated 2023-09-28.

See Also

  • stringi::stri_remove_empty().

Examples

x <- c("", "a", "b", " ", NA)
y <- strRemoveEmpty(x, naOk = TRUE, spacesOk = TRUE)
print(y)
y <- strRemoveEmpty(x, naOk = FALSE, spacesOk = FALSE)
print(y)

acidgenomics/r-acidbase documentation built on Jan. 12, 2024, 3:56 a.m.