Learn R Programming

cgwtools (version 3.2)

inverse.seqle: Inverse of seqle

Description

As with inverse.rle, this function reverses the compression performed with seqle so long as you know the incr value used to generate the compressed data.

Usage

inverse.seqle(x, incr = 1L)

Arguments

x

An object of class rle

incr

The increment between elements used to generate the compressed data object. Note that this can be either integer or float. For floating-point sequences, the reconstruction of the original series may differ at the level of floating-point precision used to generate the input object.

Value

a vector of values identical (or nearly so, for floats) to the original sequence.

See Also

seqle , inverse.rle

Examples

Run this code
# NOT RUN {
x<- c(2,2,2,3:8,8,8,4,4,4,5,5.5,6)
y<-seqle(x,incr=0)
inverse.seqle(y,0)
y <- seqle(x,incr=1)
inverse.seqle(y)
inverse.seqle(y,2) # not what you wanted
# }

Run the code above in your browser using DataLab