money_label: Converts numbers into character strings formatted as currency...

Description Usage Arguments Value Examples

Description

Converts numbers into character strings formatted as currency values, with reasonable abbreviations and significant digits. Is vectorized and can be used with ggplot's axis scaling functions - see examples.

Usage

1
scale_y_continuous(labels = money_label)

Arguments

money_values

A numeric or integer value or vector of values, to convert to currency abbreviations

cur

A character or string to prepend to the labels. Likely a currency sign - "$" by default. Use "" for no prepended string.

Value

a character vector of formatted labels

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ggplot(
 data = FPDS %>%
   group_by(Fiscal.Year, Vendor.Size) %>%
   summarize(Action.Obligation = sum(Action.Obligation)),
 aes(
   x = Fiscal.Year,
   y = Action.Obligation,
   color = Vendor.Size)) +
geom_line() +
scale_y_continuous(labels = money_label)

CSISdefense/hamre documentation built on May 31, 2019, 7:58 a.m.