inRange: Checks if x is inside a range or not

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/inRange.R

Description

Returns TRUE if x is inside a user specified range or a vector

Usage

1
inRange(x, Range = NULL, Vec = NULL)

Arguments

x

A number

Range

In the form of (a, b), where a, b are numerical values

Vec

A vector of numbers that may or may not contain x

Details

To check if x is in Range or if x is in Vec. Pass either the Range argument or the Vec argument, but not both.

Value

Returns TRUE if x is in Range or if x is in Vec, else FALSE

Author(s)

Subhrangshu Nandi, PhD Statistics, UW Madison; snandi@wisc.edu or nands31@gmail.com

See Also

lm

Examples

1
2
3
4
5
x <- 2
Range <- c(1, 3)
Vec <- c(1, 2, 3, 4)
inRange(x, Range = Range)
inRange(x, Vec = Vec)

snandi/RFunctionsSN documentation built on May 30, 2019, 5:04 a.m.