Summary.rle: Summary methods for 'rle' objects.

Description Usage Arguments Details Value Examples

View source: R/rle_utils.R

Description

Summarisation functions for vectors described in Summary are implemented for rle objects.

Usage

1
2
## S3 method for class 'rle'
Summary(..., na.rm)

Arguments

...

rle objects or objects that can be coerced to rle.

na.rm

Whether the missing values should be ignored (TRUE) or propagated (FALSE).

Details

Supported functions include all elements of the S3 Summary group. As of this writing, functions supported include (from R help) all, any, max, min, prod, range, and sum.

Value

In every supported case, the call should produce the same result as what would have resulted had the call been applied to the original (uncompressed) vector. (At no point in the calculation is the uncompressed vector actually constructed, of course.) The exception is that if values are of class integer, the result will nonetheless always be upcast to numeric to avert overflows. This behaviour may change in the future.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12

statnet/rle documentation built on Jan. 5, 2021, 3:31 a.m.