round_by | R Documentation |
Rounds a number or vector of numbers by another
round_by(x, by = 1, method = c("round", "ceiling", "floor"), include0 = TRUE)
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 |
A vector of doubles
of the same length of x
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)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.