[R] Is there in R a function equivalent to the mround, as found in most spreadsheets?
hadley wickham
h.wickham at gmail.com
Wed May 7 00:29:20 CEST 2008
>
> I believe this function matches the description in OOO:
>
> mround <- function(number, multiple) multiple * round(number/multiple)
I've implemented a slightly more general form in the reshape package:
round_any <- function (x, accuracy, f = round) {
f(x/accuracy) * accuracy
}
Hadley
--
http://had.co.nz/
More information about the R-help
mailing list