Learn R Programming

intervals (version 0.15.5)

reduce: Compactly re-represent the points in a set of intervals

Description

In general, "Intervals" and "Intervals_full" objects may be redundant, the intervals they contain may be in arbitrary order, and they may contain non-informative intervals for which one or both endpoints are NA. The reduce function re-represents the underlying subsets of the integers or the real line in the unique, minimal form, removing intervals with NA endpoints (with warning).

Usage

# S4 method for Intervals_virtual
reduce( x, check_valid = TRUE )

Value

A single object of appropriate class, compactly representing the union of all intervals in x. All intervals in reduce(x)

have numeric (i.e., not NA) endpoints.

Arguments

x

An "Intervals" or "Intervals_full" object.

check_valid

Should validObject be called before passing to compiled code? Also see interval_overlap.

See Also

See interval_union, which is really just concatenates its arguments and then calls reduce.