Learn R Programming

useful (version 1.2.6)

multiple.comma: multiple.comma

Description

Order of Magnitude Formatter

Usage

multiple.comma(x, ...)

Value

Character vector of comma formatted numbers.

Arguments

x

Vector of numbers to be formatted.

...

Further arguments to be passed on to link{multiple}

Author

Jared P. Lander

Details

Simply a wrapper for multiple that prespecifies the extra comma.

Examples

Run this code

require(scales)
vect <- c(1000, 1500, 23450, 21784, 875003780)
multiple.comma(vect)
multiple.comma(vect, multiple="k")
multiple.comma(vect, multiple="h")

require(ggplot2)
data(diamonds)
ggplot(diamonds, aes(x=x, y=y, color=price*100)) + geom_point() + 
scale_color_gradient2(labels=multiple.comma)

Run the code above in your browser using DataLab