txt_collapse: Collapse a character vector while removing missing data.

View source: R/utils.R

txt_collapseR Documentation

Collapse a character vector while removing missing data.

Description

Collapse a character vector while removing missing data.

Usage

txt_collapse(x, collapse = " ")

Arguments

x

a character vector or a list of character vectors

collapse

a character string to be used to collapse the vector. Defaults to a space: ' '.

Value

a character vector of length 1 with the content of x collapsed using paste

See Also

paste

Examples

txt_collapse(c(NA, "hello", "world", NA))

x <- list(a = c("h", "i"), b = c("some", "more", "text"), 
          c = character(), d = NA)
txt_collapse(x, collapse = " ")

udpipe documentation built on Jan. 6, 2023, 5:06 p.m.