scale_comma | R Documentation |
Wrappers around 'ggplot2::scale_x_continuous' and 'ggplot2::scale_y_continuous' to make it easy to format with commas
scale_x_comma(
...,
labels = scales::comma_format(accuracy = 1, scale = 1, prefix = "", suffix = "",
big.mark = ",", decimal.mark = ".", trim = TRUE)
)
scale_y_comma(
...,
labels = scales::comma_format(accuracy = 1, scale = 1, prefix = "", suffix = "",
big.mark = ",", decimal.mark = ".", trim = TRUE)
)
... |
Arguments to 'ggplot2::scale_x_continuous' and 'ggplot2::scale_x_continuous' |
labels |
default is 'scales::percent' See '?ggplot2::scale_x_continuous' for additional details |
https://github.com/thomas-neitmann/scalesextra
library(dplyr)
library(ggplot2)
library(palmerpenguins)
penguins %>%
ggplot(data = .,
aes(x = flipper_length_mm,
y = body_mass_g,
colour = species,
shape = species)) +
geom_point()
penguins %>%
ggplot(data = .,
aes(x = flipper_length_mm,
y = body_mass_g,
colour = species,
shape = species)) +
geom_point() +
scale_y_comma()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.