in_interval: check if values are within a given interval

Description Usage Arguments Value Examples

View source: R/in_interval.R

Description

check if values are within a given interval

Usage

1
in_interval(x, low, high, low.closed = T, high.closed = T)

Arguments

x

a numeric vector

low,high

the limits of the reference interval

low.closed,high.closed

set to TRUE for inclusion of the corresponding limit as within the interval. e.g. to test an open interval (x,y), set both to FALSE; to test a closed interval [x,y], set both to TRUE

Value

vector of logicals

Examples

1
2
3
4
vec <- 1:10
in_interval(vec, 2, 8, T, T)
in_interval(vec, 2, 8, T, F)
in_interval(vec, 2, 8, F, F)

nickfishbane/fishyTools documentation built on May 23, 2019, 4:47 p.m.