Learn R Programming

scales (version 0.2.0)

comma_format: Comma formatter: format number with commas separating thousands.

Description

Comma formatter: format number with commas separating thousands.

Usage

comma_format(...)

comma(x, ...)

Arguments

...
other arguments passed on to format
x
a numeric vector to format

Value

  • a function with single paramater x, a numeric vector, that returns a character vector

Examples

Run this code
comma_format()(c(1, 1e3, 2000, 1e6))
comma_format(digits = 9)(c(1, 1e3, 2000, 1e6))
comma(c(1, 1e3, 2000, 1e6))

Run the code above in your browser using DataLab