drle-class {matter} | R Documentation |
The drle
class stores delta-run-length-encoded vectors. These differ from other run-length-encoded vectors provided by other packages in that they allow for runs of values that each differ by a common difference (delta).
## Instance creation drle(x, cr_threshold = 0) is.drle(x) ## Additional methods documented below
x |
An integer or numeric vector to convert to delta run length encoding for |
cr_threshold |
The compression ratio threshold to use when converting a vector to delta run length encoding. The default (0) always converts the object to |
An object of class drle
.
values
:The values that begin each run.
lengths
:The length of each run.
deltas
:The difference between the values of each run.
drle
instances can be created through drle()
.
Standard generic methods:
x[i]
:Get the elements of the uncompressed vector.
length(x)
:Get the length of the uncompressed vector.
c(x, ...)
:Combine vectors.
Kylie A. Bemis
[base]{rle}
## Create a drle vector x <- c(1,1,1,1,1,6,7,8,9,10,21,32,33,34,15) y <- drle(x) # Check that their elements are equal x == y[]