Learn R Programming

tern (version 0.9.11)

format_range_cens: Format range with censoring indicators

Description

[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)

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.

Arguments

digits

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

See Also

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_fraction_threshold(), format_sigfig(), format_xx(), formatting_functions

Examples

Run this code
fmt <- format_range_cens(1L)
fmt(c(1.23, 9.87, 1, 0))
fmt(c(1.23, 9.87, 0, 0))

Run the code above in your browser using DataLab