seqle: Extends rle to find and encode linear sequences.
Description
The function rle, or "run-length encoder," is a simple compression scheme which identifies sequences of repeating values in a vector. seqle extends this scheme by allowing the user to specify a sequence of values with a common "slope," or delta value, between adjacent elements. seqle with an increment of zero is the same as rle.
a vector of the lengths (1 or greater) of all sequences found.
values
a vector of the initial value for each sequence. For example, if incr ==1 a values of 5 associated with a lengths of 3 represents the sequence 5,6,7.
Arguments
x
The input vector of values.
incr
The desired increment between elements which specifies the sequences to search for. Note that this can be either integer or float. For floating-point sequences, see the prec argument for determining what level of precision is used to determine whether elements continue a sequence or not.
prec
Defines the required precision to which elements are compared when determining whether they are part of a sequence. Note that for integer inputs, this value is more or less meaningless.
Note: the returned value is assigned the class "rle". So far as I can tell, this class has only a print method, i.e. defining what is returned to the console when the user types the name of the returned object.