R – How to change the Y-axis figures into percentages in a barplot

bar-chartggplot2r

How can we change y axis to percent like the figure? I can change y axis range but I can't make it to percent.
enter image description here

Best Answer

Use:

+ scale_y_continuous(labels = scales::percent)

Or, to specify formatting parameters for the percent:

+ scale_y_continuous(labels = scales::percent_format(accuracy = 1))

(the command labels = percent is obsolete since version 2.2.1 of ggplot2)