While collecting some corpus statistics, I came across a handy function in R that formats decimal into percentage expressions:

The function is clearly most valuable if all values are in a range of 1 to 100 percent, as the documentation also suggests: “Multiply by one hundred and display percent sign.” [1] In contrast, the sprintf equivalent may be ‘configured’ such as to show more decimal places.

On Ubuntu, the enclosing package can be installed via


  • [1] scales package documentation


  • 2017-05-03: Use library(scales) instead of library(ggplot2). Thanks to Vital!