which_interval: From a set of intervals, find which interval values belong to
Description
Returns which interval (if any) each number in a vector belongs to, given a set of
user-defined intervals. Intervals can be specified using either two-column matrices or
Intervals objects from the intervals package.
Usage
which_interval(x, Intv)
whichInterval(x, Intv)
Value
For each value in x: if x[i] is in the set of intervals, the index of the corresponding
interval(s), NA if no interval contains x[i]
Arguments
x
A vector of numeric values
Intv
A two-column matrix or an object of class Intervals