View source: R/smartEllipsis.R
smartEllipsis | R Documentation |
Employ an ellipsis, if necessary
smartEllipsis(strings, max = 2, tail = 1, empty = "None")
strings |
Vector of strings to be joined (character) |
max |
Number of strings before ellipsis (integer) |
tail |
Number of strings after the ellipsis (integer, optional) |
empty |
Returned if |
All the strings
pasted together, separated by commas,
up to a maximum of max
strings;
if strings
has more than max
elements,
the extra elements are replaced by an ellipsis.
If strings
is empty, then empty
is returned.
smartEllipsis(c("tom", "dick", "harry", "peter"), 4)
smartEllipsis(c("tom", "dick", "harry", "peter"), 3)
smartEllipsis(c("tom", "dick", "harry", "peter"), 3, tail = 0)
smartEllipsis(c("tom", "dick", "harry", "peter"), 2)
smartEllipsis(c("tom", "dick", "harry", "peter"), 2, tail = 0)
smartEllipsis(character(0), 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.