Skip to contents

[Experimental]

Formats a survival time range where the minimum and/or maximum may be a censored observation. A + suffix is appended to a bound when the corresponding censoring flag is TRUE.

Usage

format_range_cens(digits = 1L)

Arguments

digits

(integer(1))
number of decimal places to display. Defaults to 1L.

Value

An rtables formatting function that takes a numeric(4) vector of the form c(min, max, lower_censored, upper_censored), where lower_censored and upper_censored are 0/1 (or FALSE/TRUE) flags, and returns a string in the format "min to max", with + appended to min and/or max when the corresponding censoring flag is non-zero.

Examples

fmt <- format_range_cens(1L)
fmt(c(1.23, 9.87, 1, 0))
#> [1] "1.2+ to 9.9"
fmt(c(1.23, 9.87, 0, 0))
#> [1] "1.2 to 9.9"