%In% {eyelinker} | R Documentation |
Find if value belongs to a set of intervals
Description
Returns whether numeric values on the left-hand side of the operator fall within any of the
specified intervals on the right-hand side. Intervals can be specified using either two-column
matrices or Intervals
objects from the
intervals
package.
Usage
x %In% Intv
x %within% Intv
Arguments
x |
A vector of numeric values |
Intv |
A set of intervals, defined by a two-column matrix of endpoints or an Intervals object |
Value
A vector of logicals, which are true if x[i] belongs to any of the intervals in the set.
Author(s)
Simon Barthelme
Examples
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.
c(0, .6, 1.5, 3) %In% intv
[Package eyelinker version 0.2.1 Index]