between {berryFunctions} | R Documentation |
Are values between a and b?
Description
Are values within a certain interval?
Basically a wrapper for x >= a & x <= b
to save repeating long x names twice.
Usage
between(x, a, b = a, incl = TRUE, aincl = incl, bincl = incl, quiet = FALSE)
Arguments
x |
Numerical vector |
a , b |
Numerical values/vectors specifying the borders of the interval.
|
incl |
Logical. Include values on the borders? For x == border, TRUE
will be returned. Specify per left and right border separately
with the arguments |
aincl , bincl |
Logical. Include values on left and right border, respectively?
DEFAULT: |
quiet |
Logical. Suppress warning if a>b? DEFAULT: FALSE |
Value
Logical (boolean) vector with TRUE/FALSE values
Author(s)
Berry Boessenkool, berry-b@gmx.de, Aug 2017
See Also
Examples
between(1:10, 4, 8)
between(1:10, 4:8) # range as vector
between(1:10, 8, 4) # warns about interval
data.frame( incl.T=between(1:10, 4, 8),
incl.F=between(1:10, 4, 8, incl=FALSE),
aincl.F=between(1:10, 4, 8, aincl=FALSE),
bincl.F=between(1:10, 4, 8, bincl=FALSE) )
[Package berryFunctions version 1.22.5 Index]