[R] "rounding" to next lowest/highest 'x%%y' (mod) equals zero?

Richard M. Heiberger rmh at temple.edu
Fri Aug 24 16:23:47 CEST 2007


> tmp <- c(0,.5,1.5,2.1,3.1,4)
> floor(tmp/2)
[1] 0 0 0 1 1 2
> floor(tmp/2)*2
[1] 0 0 0 2 2 4
>



More information about the R-help mailing list