| %[c]% | R Documentation |
Functions for evaluating if values of vectors are within intervals,
or less than or higher than interval endpoints.
The c within the brackets refer to cut,
a similar function.
x %[c]% interval
x %[c)% interval
x %(c]% interval
x %(c)% interval
x |
vector or |
interval |
vector, 2-column matrix, list, or |
Values of x are compared to interval endpoints
a and b (a <= b) (see %[]% for details).
The functions return an integer vector taking values
-1L (value of x is less than or equal to a,
depending on the interval type),
0L (value of x is inside the interval), or
1L (value of x is greater than or equal to b,
depending on the interval type).
Peter Solymos <solymos@ualberta.ca>
Similar functions (but not quite): sign,
cut, .bincode, findInterval.
See relational operators for intervals: %[]%.
See Syntax for operator precedence.
x <- 1:5
x %[c]% c(2,4)
x %[c)% c(2,4)
x %(c]% c(2,4)
x %(c)% c(2,4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.