n_pct | R Documentation |
This function is especially useful when used in Rmarkdown documents or tables.
n_pct(x, total, digits = 1, brackets = TRUE, ...)
x |
Numerator, will also be displayed as n (never prints with trailing zeros.) |
total |
Denominator |
digits |
Digits to display after decimal point for percentage only |
brackets |
Whether percentages should be displayed in bracktes, alternative is seperation with "," |
... |
additional arguments passed to bernr::comma() |
Character object
n_pct(10, 1000) # 10.0 (1.0%) n_pct(10, 1000, trailing = TRUE, brackets = FALSE) # 10.0, 1.0% n_pct(10, 1000, trailing = FALSE, brackets = FALSE) # 10, 1%
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.