powered by
Rounds a number or vector of numbers by another
round_by(x, by = 1, method = c("round", "ceiling", "floor"), include0 = TRUE)
A vector of doubles of the same length of x
doubles
x
A number or vector to round.
The number by which to round
An option to explicitly specify automatic rounding, ceiling, or floor
If FALSE replaces 0 with by
FALSE
0
by
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) )
Run the code above in your browser using DataLab