count_fraction {junco} | R Documentation |
Formatting count and fraction values
Description
Formats a count together with fraction (and/or denominator) with special
consideration when count is 0, or fraction is 1.
See also: tern::format_count_fraction_fixed_dp()
Usage
jjcsformat_count_fraction(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. |
Value
A string in the format count / denom (ratio percent)
. If count
is 0, the format is 0
. If fraction is >0.99, the format is
count / denom (>99.9 percent)
See Also
Other JJCS formats:
format_xx_fct()
,
jjcsformat_pval_fct()
,
jjcsformat_range_fct()
Examples
jjcsformat_count_fraction(c(7, 0.7))
jjcsformat_count_fraction(c(70000, 0.9999999))
jjcsformat_count_fraction(c(70000, 1))