paste_ | R Documentation |
This function behaves like base::paste(), but replaces any NA elements with an empty string. It also supports vector recycling and accepts the 'sep' and 'collapse' arguments.
paste_(..., sep = " ", collapse = NULL)
... |
The arguments to be concatenated. These can be vectors. |
sep |
The string that separates the concatenated elements. Defaults to a single space. |
collapse |
An optional string to separate the results. NULL by default, which means no separation. |
A character vector of concatenated strings.
paste_("hello", NA, "you")
# returns "hello you"
paste_(c("hello", "world"), c(NA, "everyone"), c("you", NA))
# returns c("hello you", "world everyone")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.