multiple.comma: multiple.comma

View source: R/formatters.r

multiple.commaR Documentation

multiple.comma

Description

Order of Magnitude Formatter

Usage

multiple.comma(x, digits = 0, ...)

Arguments

x

Vector of numbers to be formatted.

digits

Number of decimal places for rounding.

...

Further arguments to be passed on to multiple

Details

Simply a wrapper for multiple that prespecifies the extra comma.

Value

Character vector of comma formatted numbers.

Author(s)

Jared P. Lander

Examples


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)


jaredlander/useful documentation built on Nov. 4, 2023, 10:56 a.m.