str_flatten | R Documentation |
A version of stringr::str_flatten()
with support for removing empty (zero-length)
strings prior to flattening.
str_flatten(
s,
collapse = "",
last = NULL,
na.rm = FALSE,
rm.empty = TRUE,
unique = TRUE
)
str_flatten_comma(
s,
last = NULL,
na.rm = FALSE,
rm.empty = TRUE,
unique = TRUE
)
s |
Input vector. Either a character vector or something coercible into one. |
collapse |
String to insert between each piece. Defaults to "". |
last |
Optional string to use in place of the final separator. |
na.rm |
Remove missing values? |
rm.empty |
Remove empty values? If TRUE, empty strings "" are removed. Sets na.rm=TRUE as well. |
unique |
Uniquify string vector before collapsing. |
A string, i.e. a character vector of length 1.
str_flatten_comma()
: variation designed to mirror stringr::str_flatten_comma()
but with
removing empty strings.
stringr::str_flatten()
str_flatten_comma()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.