
Function factory for range with censoring information formatting
Source:R/jjcsformats.R
jjcsformat_range_fct.Rd
A function factory to generate formatting functions for range formatting that includes information about the censoring of survival times.
Value
A function that formats a numeric vector with 4 elements:
minimum
maximum
censored minimum? (1 if censored, 0 if event)
censored maximum? (1 if censored, 0 if event) The range along with the censoring information is returned as a string with the specified numeric format as
(min, max)
, and the+
is appended tomin
ormax
if these have been censored.
See also
Other JJCS formats:
count_fraction
,
format_xx_fct()
,
jjcsformat_pval_fct()
Examples
my_range_format <- jjcsformat_range_fct("xx.xx")
my_range_format(c(0.35235, 99.2342, 1, 0))
#> [1] "(0.35+, 99.23)"
my_range_format(c(0.35235, 99.2342, 0, 1))
#> [1] "(0.35, 99.23+)"
my_range_format(c(0.35235, 99.2342, 0, 0))
#> [1] "(0.35, 99.23)"
my_range_format(c(0.35235, 99.2342, 1, 1))
#> [1] "(0.35+, 99.23+)"