Description Usage Arguments Value Examples
Collapse a character vector to a list suitable for an English sentence.
1 2 | collapse_to_sentence(vector, conjunction = "and", oxford_comma = TRUE,
terminal_period = FALSE)
|
vector |
The character vector to collapse (2 or more elements). |
conjunction |
The word to use as a conjunction (no spaces). |
oxford_comma |
Logical indicating whether the oxford comma should be used. |
terminal_period |
Logical indicating whether a period should be appended. |
A single element character vector containing all the elements of
vector
separated by commas and conjoined by conjunction.
1 2 3 | collapse_to_sentence(c("eats", "shoots", "leaves"), oxford_comma = FALSE)
collapse_to_sentence(c("my way", "the highway"), conjunction = "or")
collapse_to_sentence(1:10, conjunction = "or", terminal_period = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.