Learn R Programming

bazar (version 1.0.11)

rle2: Run length encoding (modified version)

Description

Compute the lengths and values of runs of almost.equal values in a vector.

Usage

rle2(x, tolerance = sqrt(.Machine$double.eps))

Arguments

x

numeric vector.

tolerance

numeric. Differences smaller than tolerance are considered as equal. The default value is close to 1.5e-8.

Value

An object of class "rle" which is a list with components:

  • lengths: an integer vector containing the length of each run.

  • values: a vector of the same length as lengths with the corresponding values.

See Also

almost.equal in this package; rle in package base.