Learn R Programming

tis (version 1.39)

between: Check for Inclusion in a Closed Interval

Description

Returns a logical vector like y showing if each element lies in the closed interval [min(x1, x2), max(x1, x2)].

Usage

between(y, x1, x2)

Arguments

y

a numeric object

x1

a number

x2

a number

Value

A logical object like y.

Examples

Run this code
# NOT RUN {
mat <- matrix(rnorm(16), 4, 4)
mat
between(mat, -2, 1)
# }

Run the code above in your browser using DataLab