I am trying to edit the Y-axis scale to represent the amount the rows of Id. The numbers needed to be shown on the scale are in the millions. I need to abbreviate the number in order for it to be seen on the visualization.
ggplot(sleeptocalories1, aes(Id,TotalCalories) +
geom_col(fill="steelblue") +
theme(axis.text.x = element_text(angle = 90)) +
theme(axis.text.y = element_text(angle = 45))
I like scales::label_number_si()
:
ggplot(data.frame(x = 1:5, y = 10^(2:6)), aes(x, y)) +
geom_col() +
scale_y_continuous(labels = scales::label_number_si())
On your data, it might be:
ggplot(sleeptocalories1, aes(Id,TotalCalories) +
geom_col(fill="steelblue") +
theme(axis.text.x = element_text(angle = 90)) +
theme(axis.text.y = element_text(angle = 45)) +
scale_y_continuous(labels = scales::label_number_si())