| collapse_head | R Documentation |
Collapse head of vector with commas followed by ellipsis
collapse_head(x, maxlength = 6L, format_fn = identity)
x |
Vector: Input whose first elements are shown. |
maxlength |
Integer: Maximum number of elements to show before truncating with an ellipsis. Use -1 to show all. |
format_fn |
Function: Formatting function applied to each element. |
Used, for example, by repr_ls
Character.
EDG
collapse_head(98054:99890, maxlength = 5L)
collapse_head(
c("mango", "banana", "tangerine", "sugar", "ackee", "cocoa bean"),
maxlength = 3L, format_fn = toupper
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.