round_by {mark} | R Documentation |
Rounding by a specific interval.
Description
Rounds a number or vector of numbers by another
Usage
round_by(x, by = 1, method = c("round", "ceiling", "floor"), include0 = TRUE)
Arguments
x |
A number or vector to round. |
by |
The number by which to round |
method |
An option to explicitly specify automatic rounding, ceiling, or floor |
include0 |
If |
Value
A vector of doubles
of the same length of x
Examples
x <- seq(1, 13, by = 4/3)
cbind(
x,
by_1 = round_by(x, 1),
by_2 = round_by(x, 2),
by_3 = round_by(x, 3)
)
[Package mark version 0.8.0 Index]