paste_xy | R Documentation |
These are similar to paste()
but by default ignore NA
and empty strings
(""
). If they are found in a conflicting column we return the value from
the other column without using the separator. If both columns have such values
we return an empty string.
paste_xy(x, y, sep = " ", na = NULL, ignore_empty = TRUE) paste_yx(x, y, sep = " ", na = NULL, ignore_empty = TRUE)
x |
A vector |
y |
A vector |
sep |
separator |
na |
How to treat |
ignore_empty |
Whether to ignore empty strings, to avoid trailing and leading separators |
A character vector
paste_xy(letters[1:3], c("d", NA, "")) paste_yx(letters[1:3], c("d", NA, "")) paste_xy(letters[1:3], c("d", NA, ""), na = NA, ignore_empty = FALSE) paste_xy(letters[1:3], c("d", NA, ""), na = "NA", ignore_empty = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.