Description Usage Arguments Value Examples
Bound a number by two other numbers, or divide, round, and bound
1 2 3 |
num |
Numeric vector to bound. |
lower |
Lower bound to floor the result at. |
upper |
Upper bound to cap the result at. |
div |
Numeric vector to divide |
type |
Type of rounding to be performed (one of "floor", "ceiling", or "round"). |
bound
: bounded numeric vector.
divide_round_bound
: divided, rounded, and bounded integer vector.
1 2 3 4 5 6 7 8 9 10 11 | bound(1:10, 2, 8)
bound(runif(10), 0.25, 0.75)
bound(1:5, upper = 3)
bound(1:5, lower = 3)
divide_round_bound(1:10, 2, 2, 4)
divide_round_bound(runif(10), 0.01, 20, 80)
divide_round_bound(1:100, 10, type = "ceiling")
divide_round_bound(1:100, 10, type = "floor")
divide_round_bound(1:100, 10, type = "round")
divide_round_bound(1:100, 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.