whichInterval: From a set of intervals, find which interval values belong to

Description Usage Arguments Value Author(s) See Also Examples

Description

This utility function is a replacement for findIntervals that works even when the set of intervals is discontinuous. It wraps "which_nearest" from the intervals package.

Usage

1
whichInterval(x, Intv)

Arguments

x

a set of numeric values

Intv

a two-column matrix or an object of class Intervals

Value

for each value in x: if x[i] in in the set of intervals, the index of the corresponding interval(s), NA if no interval contains x[i]

Author(s)

Simon Barthelme

See Also

'

Examples

1
2
3
4
start <- c(0,1,2)
end <- c(.5,1.3,3)
intv <- cbind(start,end) #The first interval is 0-0.5, second is 1-1.3, etc. 
whichInterval(seq(0,3,l=10),intv)

dahtah/eyelinker documentation built on May 14, 2019, 3:25 p.m.