| txt_paste | R Documentation | 
NA friendly version for concatenating string
txt_paste(..., collapse = " ", na.rm = FALSE)
... | 
 character vectors  | 
collapse | 
 a character string to be used to paste the vectors together. Defaults to a space: ' '.  | 
na.rm | 
 logical, if set to   | 
a character vector
paste
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.