%[c]% {intrval}R Documentation

Dividing a Range Into 3 Intervals

Description

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.

Usage

x %[c]% interval
x %[c)% interval
x %(c]% interval
x %(c)% interval

Arguments

x

vector or NULL: the values to be compared to interval endpoints.

interval

vector, 2-column matrix, list, or NULL: the interval end points.

Value

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).

Author(s)

Peter Solymos <solymos@ualberta.ca>

See Also

Similar functions (but not quite): sign, cut, .bincode, findInterval.

See relational operators for intervals: %[]%.

See Syntax for operator precedence.

Examples

x <- 1:5
x %[c]% c(2,4)
x %[c)% c(2,4)
x %(c]% c(2,4)
x %(c)% c(2,4)

[Package intrval version 0.1-3 Index]