seqCollapse | R Documentation |
Collapse a numeric sequence into a compact form that represents continuous ranges and discontinuous values.
seqCollapse(x, sequential = "-", skips = ", ")
x |
an integer vector, missing values and repeated values are permitted and removed before collapsing. |
sequential |
the separator for sequential values. |
skips |
the separator for gaps in the sequence. |
A character string that represents that data in x
in a compact
form. If x
is empty, then "" is returned.
This function is commonly used to express years in a compact form.
paste
# A single value seqCollapse(1968) # A single, continuous range of values seqCollapse(1968:1992) # A collection of continuous and individual values seqCollapse(c(1968:1992, 1998, 2002, 2006:2012))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.