Inverse Run Length Encoding (Alternate Implementation)

Description

Re-construct vector compressed by rle2.

Usage

1

Arguments

x

Object returned by rle2.

Value

Numeric or character vector.

Note

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.

Author(s)

Dane R. Van Domelen

References

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

See Also

rle2, rle, inverse.rle

Examples

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)