
Last chance! 50% off unlimited learning
Sale ends in
Are values within a certain interval?
Basically a wrapper for x >= a & x <= b
to save repeating long x names twice.
between(x, a, b = a, incl = TRUE, aincl = incl, bincl = incl,
quiet = FALSE)
Numerical vector
Numerical values/vectors specifying the borders of the interval.
min
and max
are used, so they can be a vector.
Logical. Include values on the borders? For x == border, TRUE
will be returned. Specify per left and right border separately
with the arguments aincl
and bincl
. DEFAULT: TRUE
Logical. Include values on left and right border, respectively?
DEFAULT: incl
Logical. Suppress warning if a>b? DEFAULT: FALSE
Logical (boolean) vector with TRUE/FALSE values
# NOT RUN {
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) )
# }
Run the code above in your browser using DataLab