txt_paste {udpipe} | R Documentation |
Concatenate strings with options how to handle missing data
Description
NA friendly version for concatenating string
Usage
txt_paste(..., collapse = " ", na.rm = FALSE)
Arguments
... |
character vectors |
collapse |
a character string to be used to paste the vectors together. Defaults to a space: ' '. |
na.rm |
logical, if set to |
Value
a character vector
See Also
Examples
x <- c(1, 2, 3, NA, NA)
y <- c("a", "b", "c", NA, "OK")
paste(x, y, sep = "-")
txt_paste(x, y, collapse = "-", na.rm = TRUE)
txt_paste(x, y, collapse = "-", na.rm = FALSE)
x <- c(NA, "a", "b")
y <- c("1", "2", NA)
z <- c("-", "*", NA)
txt_paste(x, y, z, collapse = "", na.rm = TRUE)
txt_paste(x, y, z, "_____", collapse = "", na.rm = TRUE)
txt_paste(x, y, z, "_____", collapse = "", na.rm = FALSE)
[Package udpipe version 0.8.11 Index]