Description Usage Arguments Value Note Author(s) References See Also Examples
Re-construct vector compressed by rle2.
1 | inverse.rle2(x)
|
x |
Object returned by rle2. |
Numeric or character vector.
This function expands a vector compressed by rle2. It basically just re-formats the object generated by rle2 and then calls inverse.rle. It also works on vectors compressed by rle, but there is no advantage to using inverse.rle2 rather than inverse.rle in that scenario.
Dane R. Van Domelen
Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.
1 2 3 4 5 6 7 8 | # Create dummie vector x
x <- c(0, 0, 0, -1, -1, 10, 10, 4, 6, 6)
# Summarize x using rle2
x.summarized <- rle2(x)
# Reconstruct x
x.reconstructed <- inverse.rle2(x.summarized)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.