report_percent | R Documentation |
Follows the advice from: http://adc.bmj.com/content/early/2015/04/15/archdischild-2014-307149 "Percentages: [Use] integers, or one decimal place for values under 10 Values over 90 Use two or more decimal places only if the range of values is less than 0.1
report_percent(x, round_90_to_one = FALSE, as_char = TRUE)
x |
Numeric vector of percentages. |
round_90_to_one |
Should values above 90 percent be reported to a single decimal place? |
as_char |
Should the result be returned as a character vector? Default 'TRUE'. |
Character vector of formatted percentages following these rounding rules
report_percent(c(2.5, 11.324, 95.898, 99.6))
report_percent(c(2.5, 11.324, 95.898, 99.6), round_90_to_one = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.