multiple.comma | R Documentation |
Order of Magnitude Formatter
multiple.comma(x, digits = 0, ...)
x |
Vector of numbers to be formatted. |
digits |
Number of decimal places for rounding. |
... |
Further arguments to be passed on to |
Simply a wrapper for multiple that prespecifies the extra comma.
Character vector of comma formatted numbers.
Jared P. Lander
library(scales)
vect <- c(1000, 1500, 23450, 21784, 875003780)
multiple.comma(vect)
multiple.comma(vect, multiple="k")
multiple.comma(vect, multiple="h")
library(ggplot2)
data(diamonds)
ggplot(diamonds, aes(x=x, y=y, color=price*100)) + geom_point() +
scale_color_gradient2(labels=multiple.comma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.