extreme_format | R Documentation |
rtables
formatting functions that handle extreme values.
h_get_format_threshold(digits = 2L)
h_format_threshold(x, digits = 2L)
digits |
( |
x |
( |
For each input, apply a format to the specified number of digits
. If the value is
below a threshold, it returns "<0.01" e.g. if the number of digits
is 2. If the value is
above a threshold, it returns ">999.99" e.g. if the number of digits
is 2.
If it is zero, then returns "0.00".
h_get_format_threshold()
returns a list
of 2 elements: threshold
, with low
and high
thresholds,
and format_string
, with thresholds formatted as strings.
h_format_threshold()
returns the given value, or if the value is not within the digit threshold the relation
of the given value to the digit threshold, as a formatted string.
h_get_format_threshold()
: Internal helper function to calculate the threshold and create formatted strings
used in Formatting Functions. Returns a list with elements threshold
and format_string
.
h_format_threshold()
: Internal helper function to apply a threshold format to a value.
Creates a formatted string to be used in Formatting Functions.
Other formatting functions:
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_fraction_threshold()
,
format_sigfig()
,
format_xx()
,
formatting_functions
h_get_format_threshold(2L)
h_format_threshold(0.001)
h_format_threshold(1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.