roundAny | R Documentation |
Round a number to nearest multiple of a given number
roundAny(x, y, fun = round)
x |
Numeric vector |
y |
Multiple to round to |
fun |
function for rounding, either |
Vector of rounded values
a <- seq(1, 20, 0.5)
roundAny(a, 2)
roundAny(a, 2, floor)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.