round_unit | R Documentation |
Round numbers to nice intervals with the following options:
round up to the nearest power of 10
round down to the nearest power of 10
round up to the nearest "nice" value. From http://stackoverflow.com/questions/6461209/how-to-round-up-to-the-nearest-10-or-100-or-x)
round up x to the nearest b
round x down to the nearest b
round x up or down to the nearest b; direction depends on how close x is to b
creates a vector evenly spaced on a log 10 scale: 10 points across each order of magnitude
round_unit(x, b)
x |
the number or vector of numbers to be rounded |
b |
the unit to round the number to (applies to
|
a rounded number
round_up(c(4, 1, 101, 99, 1002))
round_down_unit(1.23, 0.1)
round_down_unit(x = c(4, 1, 101, 99, 1002), b = 25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.