Label functions for ggplot2 scales (or for any vector of numbers) that
follow the current language setting (see gtl_opt_set_i18n()): an
apostrophe between thousands in every language (60'000), a decimal comma in
French and German (2,5) and a space before the percent sign in French and
German (2,5 %). The language is read when the numbers are formatted.
Arguments
- ...
Arguments passed on to
scales::number()orscales::percent()(accuracy,scale,suffix...)
Examples
gtl_opt_set_i18n("fr_CH")
gtl_label_number()(c(60000, 2.5))
#> [1] "60'000" "2"
gtl_label_percent(accuracy = 0.1)(0.025)
#> [1] "2,5 %"
gtl_opt_set_i18n("en_US")
gtl_label_number()(c(60000, 2.5))
#> [1] "60'000" "2"
gtl_label_percent(accuracy = 0.1)(0.025)
#> [1] "2.5%"
