vec_to_sentence | R Documentation |
Turn a vector into a phrase with a final 'and' (or other separator). If sep
is ";" the final is sep
plus end
.
vec_to_sentence(x, sep = ",", end = "and", na_rm = TRUE)
x |
Character. Vector to collapse to phrase |
sep |
Character. Separator between all except last |
end |
Character. Last separator |
na_rm |
Logical. Remove |
Character.
x <- c("apples", "bannanas", "pears", NA, "grapes")
vec_to_sentence(x)
vec_to_sentence(x, end = "&")
vec_to_sentence(x, ";")
vec_to_sentence(x, na_rm = F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.