Description Usage Arguments Value Author(s)
This is a simple function to check whether a value is contained within the interval [lo, hi]
. The
function also allows specifying whether the interval is closed on the left, i.e. (lo, hi])
, on the right only,
i.e. [lo, hi)
, or both (lo, hi)
.
1 | in_interval(x, lo, hi, closed.right=TRUE, closed.left=TRUE)
|
x |
A numeric value. |
lo |
A numeric value specifying the lower bound of the interval. |
hi |
A numeric value specifying the upper bound of the interval. |
closed.right |
Boolean; is the interval closed on the right (upper) side? Defaults to |
closed.left |
Boolean; is the interval closed on the left (lower) side? Defaults to |
TRUE
if the value x
lies within the interval, FALSE
if it does not.
Ryan Kyle, ryan.kyle@mail.mcgill.ca
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.