jjcsformat_fraction_count_denom {junco} | R Documentation |
Formatting fraction, count and denominator values
Description
Formatting fraction, count and denominator values
Usage
jjcsformat_fraction_count_denom(x, d = 1, roundmethod = c("sas", "iec"), ...)
Arguments
x |
|
d |
numeric(1). Number of digits to round fraction to (default=1) |
roundmethod |
(
|
... |
Additional arguments passed to other methods. |
Details
Formats a 3-dimensional value such that percent values
near 0 or 100% are formatted as .e.g, "<0.1%"
and
">99.9%"
, where the cutoff is controled by d
, and
formatted as "xx.x% (xx/xx)"
otherwise, with the
precision of the percent also controlled by d
.
Value
x
formatted as a string with d
digits of precision,
with special cased values as described in Details above.
Examples
jjcsformat_fraction_count_denom(c(7, 10, 0.7))
jjcsformat_fraction_count_denom(c(70000, 70001, 70000 / 70001))
jjcsformat_fraction_count_denom(c(235, 235, 235 / 235))