swfscMisc (version 1.3)

isBetween: Between

Description

Is a numeric value between two other values?

Usage

isBetween(x, a, b = NULL, include.ends = FALSE, na.convert = TRUE)

Arguments

x

vector of numeric values to check.

a, b

numeric values describing range.

include.ends

logical. Should test include a and b? Is test > and < or >= and <= ?

na.convert

logical. If TRUE and result of test is NA because either x, a, or b is NA, return FALSE, otherwise return NA.

Details

Order of a and b does not matter. If b is NULL the range will be taken from values in a.