fold | R Documentation |
Produces a readout like "January, February, and 10 others"
.
fold(vec, n = 2)
vec |
(Vector) The vector you want to print. |
n |
(Integer) The maximum number of vector elements to show. |
A character vector of length 1 containing the readout (or NA
).
Desi Quintans (http://www.desiquintans.com)
month.name
#> [1] "January" "February" "March" "April" "May" "June"
#> [7] "July" "August" "September" "October" "November" "December"
fold(month.name)
#> January, February, and 10 others
fold(1:20, n = 5)
#> 1, 2, 3, 4, 5, and 15 others
fold(character(0), n = 1)
#> [1] NA
fold(1:10, n = 0)
#> [1] NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.