>
> 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/
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.