round2 | R Documentation |
Standard rounding rather than R's round function which uses bankers rounding
round2(x, n)
x |
Number to be rounded |
n |
Decimal places to be rounded to |
The number rounded to the nearest integer where .5 is always rounded up
x <- 2.3 n <- 0 round2(x, n) x <- 1.85 n <- 1 round2(x, n) x <- 10.988 n <- 2 round2(x, n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.