Last active
July 18, 2026 19:58
-
-
Save jonesor/4210128 to your computer and use it in GitHub Desktop.
R function to round up to a number divisible by n.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Round x up to the nearest multiple of n. | |
| roundup <- function(x, n){ceiling(x / n) * n} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment