pct | R Documentation |
This function is especially useful when used in Rmarkdown documents.
pct(x, total, digits = 1, trailing = TRUE)
x |
Numerator |
total |
Denominator |
digits |
Digits to display after decimal point |
trailing |
Whether trailing zeroes should be displayed |
A character object
pct(10, 100) #"10.0%" pct(10, 100, trailing = FALSE) #"10%"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.