R/utils.R
percent.Rd
Format decimals to percentages
percent(x, digits = 2, format = "f")
An array of decimals
number of digits
f
An array of formatted strings
nums <- c(0.42, 0.15, 0.4, 0.563, 0.2) percent(nums) #> [1] "42.00%" "15.00%" "40.00%" "56.30%" "20.00%"