Description Usage Arguments Value Examples
f_list
- Format a vector of elements as a list series
(e.g., c('A', 'B', 'C')
becomes "A, B, and C"
).
f_list_amp
- A ampersand wrapper for f_list
with
and = '&'
set by default.
1 2 3 4 5 |
x |
A vector of values to turn into a collapsed series. |
and |
The value to use for the 'and'. Commonly |
oxford |
logical. If |
... |
ignored. |
Returns a string that is a list series.
1 2 3 4 5 6 7 8 9 10 11 12 13 | f_list(1)
f_list(1:2)
f_list(1:3)
f_list(1:5)
x <- c("parents", "Lady Gaga", "Humpty Dumpty")
## Three things you love
sprintf('I love my %s.', f_list(x))
## Your parents are lady Gaga & Humpty Dumpty?????
sprintf('I love my %s.', f_list(x, oxford = FALSE))
sprintf('I love my %s.', f_list(x, and = '&'))
sprintf('I love my %s.', f_list_amp(x))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.