as_perc {tldr} | R Documentation |
Format a proportion as a percentage
Description
as_perc
formats a proportion as a percentage to print in an RMarkdown
document
Usage
as_perc(p, digits = 0)
Arguments
p |
A length-1 numeric to be interpreted as a proportion |
digits |
Number of digits to round percentage to (default to 0) |
Details
Simply multiplies p
by 100 and affixes a percent sign to the end after
rounding.
Value
Returns a string to report a percentage to the specified number of digits.
Examples
as_perc(0.2345)
as_perc(0.000234)
[Package tldr version 0.4.0 Index]