View source: R/formatting_functions.R
format_fraction_threshold | R Documentation |
Formats a fraction when the second element of the input x
is the fraction. It applies
a lower threshold, below which it is just stated that the fraction is smaller than that.
format_fraction_threshold(threshold)
threshold |
( |
An rtables
formatting function that takes numeric input x
where the second
element is the fraction that is formatted. If the fraction is above or equal to the threshold,
then it is displayed in percentage. If it is positive but below the threshold, it returns,
e.g. "<1" if the threshold is 0.01
. If it is zero, then just "0" is returned.
Other formatting functions:
extreme_format
,
format_auto()
,
format_count_fraction()
,
format_count_fraction_fixed_dp()
,
format_count_fraction_lt10()
,
format_extreme_values()
,
format_extreme_values_ci()
,
format_fraction()
,
format_fraction_fixed_dp()
,
format_sigfig()
,
format_xx()
,
formatting_functions
format_fun <- format_fraction_threshold(0.05)
format_fun(x = c(20, 0.1))
format_fun(x = c(2, 0.01))
format_fun(x = c(0, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.