check-vector-isInRange | R Documentation |
Is the input in range?
isInRange(x, lower = -Inf, upper = Inf, closed = c(TRUE, TRUE))
isInClosedRange(x, lower = -Inf, upper = Inf)
isInOpenRange(x, lower = -Inf, upper = Inf)
isInLeftOpenRange(x, lower = -Inf, upper = Inf)
isInRightOpenRange(x, lower = -Inf, upper = Inf)
isNegative(x)
isPositive(x)
isNonNegative(x)
isNonPositive(x)
isPercentage(x)
isProportion(x)
allAreInRange(x, lower = -Inf, upper = Inf, closed = c(TRUE, TRUE))
allAreInClosedRange(x, lower = -Inf, upper = Inf)
allAreInOpenRange(x, lower = -Inf, upper = Inf)
allAreInLeftOpenRange(x, lower = -Inf, upper = Inf)
allAreInRightOpenRange(x, lower = -Inf, upper = Inf)
allAreNegative(x)
allArePositive(x)
allAreNonNegative(x)
allAreNonPositive(x)
allArePercentage(x)
allAreProportion(x)
x |
Object. |
lower |
|
upper |
|
closed |
|
TRUE
on success;
FALSE
on failure, with cause set.
isInRange()
: Vectorized.
isInClosedRange()
: Vectorized.
isInOpenRange()
: Vectorized.
isInLeftOpenRange()
: Vectorized.
isInRightOpenRange()
: Vectorized.
isNegative()
: Vectorized.
isPositive()
: Vectorized.
isNonNegative()
: Vectorized.
isNonPositive()
: Vectorized.
isPercentage()
: Vectorized.
isProportion()
: Vectorized.
allAreInRange()
: Scalar.
allAreInClosedRange()
: Scalar.
allAreInOpenRange()
: Scalar.
allAreInLeftOpenRange()
: Scalar.
allAreInRightOpenRange()
: Scalar.
allAreNegative()
: Scalar.
allArePositive()
: Scalar.
allAreNonNegative()
: Scalar.
allAreNonPositive()
: Scalar.
allArePercentage()
: Scalar.
allAreProportion()
: Scalar.
Closed: Includes all its limit points, and is denoted with square brackets.
For example, [0,1]
means greater than or equal to 0 and less than or
equal to 1.
Open: Does not include its endpoints, and is indicated with parentheses.
For example, (0,1)
means greater than 0 and less than 1.
Updated 2023-09-29.
assertive.numbers::is_in_range()
.
assertive.numbers::is_in_closed_range()
.
assertive.numbers::is_in_open_range()
.
assertive.numbers::is_in_left_open_range()
.
assertive.numbers::is_in_right_open_range()
.
assertive.numbers::is_negative()
.
assertive.numbers::is_positive()
.
assertive.numbers::is_non_negative()
.
assertive.numbers::is_non_positive()
.
assertive.numbers::is_percentage()
.
assertive.numbers::is_proportion()
.
## TRUE ====
isInRange(0, lower = 0, upper = 1)
isInRange(1, lower = 0, upper = 1)
isInClosedRange(1, lower = 0, upper = 1)
isInOpenRange(0.5, lower = 0, upper = 1)
isInLeftOpenRange(1, lower = 0, upper = 1)
isInRightOpenRange(0, lower = 0, upper = 1)
isNegative(c(-2, -1))
isPositive(c(1, 2))
isNonNegative(c(0, 1))
isNonPositive(c(-1, 0))
isPercentage(c(0, 25, 50, 100))
isProportion(c(0, 0.01, 0.1, 1))
## FALSE ====
isInRange(c(-1, 2), lower = 0, upper = 1)
isInClosedRange(c(0, 1), lower = 0, upper = 1)
isInOpenRange(c(1, 2), lower = 0, upper = 1)
isInLeftOpenRange(0, lower = 0)
isInRightOpenRange(1, upper = 1)
isPositive(-1)
isNegative(1)
isPercentage(110)
isProportion(1.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.