| %within% | R Documentation |
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.
x %within% Intv
x %In% Intv
x |
A vector of numeric values |
Intv |
A set of intervals, defined by a two-column matrix of endpoints or an Intervals object |
A vector of logicals, which are true if x[i] belongs to any of the intervals in the set.
Simon Barthelme
start <- c(0, 1, 2)
end <- c(.5, 1.3, 3)
intv <- cbind(start, end) # The 1st interval is 0.0-0.5, 2nd is 1.0-1.3, etc.
c(0, 0.6, 1.5, 3) %within% intv
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.