Concatenate Character Vectors
Concatenate character vectors and omit empty strings.
paste_strings(..., collapse = " ", recycle0 = FALSE)
...
: 'character' vectors (or objects coercible to character vectors). Corresponding elements are to be concatenated.collapse
: 'character' string. Seperates the results.recycle0
: 'logical' flag. Whether a zero-length character argument should lead to a zero-length character (character(0)
) being returned.Returns a character vector.
paste_strings(letters, c(), c(1, 2, 3)) paste_strings(letters, c(), c(1, 2, 3), recycle0 = TRUE)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Useful links