Skip to contents

Set Up a Survival Curve Configuration

Usage

setup_SurvivalConfig(
  time = "time",
  survival = "survival",
  group = NULL,
  lower = NULL,
  upper = NULL,
  n_censor = NULL,
  n_risk = NULL,
  show_ci = TRUE,
  show_censors = TRUE,
  show_median = FALSE,
  landmarks = NULL,
  risk_table = FALSE,
  ci_opacity = 0.15,
  line_width = 2,
  censor_size = 8,
  digits = 3L,
  palette = NULL,
  legend = TRUE,
  xlab = "Time",
  ylab = "Survival probability",
  legend_position = "top",
  legend_placement = "outside",
  legend_title = NULL,
  title = NULL,
  dat_path = NULL,
  origin = NULL,
  writer = NULL
)

Arguments

time

Character: Time column in the curve records.

survival

Character: Survival probability column.

group

Optional Character: Curve group column.

lower, upper

Optional Character: Pointwise confidence bound columns.

n_censor

Optional Character: Censor count column.

n_risk

Optional Character: Risk count column at recorded times.

show_ci

Logical: Draw available pointwise confidence bands.

show_censors

Logical: Draw censor ticks.

show_median

Logical: Draw median survival droplines when estimable.

landmarks

Optional Numeric vector: Finite times for survival labels.

risk_table

Logical: Draw supplied risk records beneath the curves.

ci_opacity

Numeric [0, 1]: Confidence band opacity.

line_width

Numeric: Curve stroke width in pixels.

censor_size

Numeric (0, Inf): Censor tick height in pixels.

digits

Integer: Decimal places for AUC labels and tooltip values.

palette

Optional Character: Group colors; unset uses the chart theme.

legend

Logical: Show group labels and AUC summaries.

xlab

Character: Horizontal axis label.

ylab

Character: Vertical axis label.

legend_position

Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row.

legend_placement

Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend.

legend_title

Optional Character: Title drawn with the legend or colorbar: above left/right legends and vertical colorbars, before the first row of top/bottom legends and horizontal colorbars. NULL draws no title. A title does not add a missing legend.

title

Optional Character: Chart title.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

origin

Optional Named character: Per-property provenance.

writer

Optional Named character: Interface name and version.

Value

A SurvivalConfig object.

Examples

setup_SurvivalConfig(group = "treatment", show_median = TRUE)
#> <SurvivalConfig>
#> 
#>               type: <chr> survival
#>           dat_path: <NUL> NULL
#>              title: <NUL> NULL
#>             origin: <chr> default, default, default, default, ...
#>             writer: <NUL> NULL
#>    legend_position: <chr> top
#>   legend_placement: <chr> outside
#>       legend_title: <NUL> NULL
#>               time: <chr> time
#>           survival: <chr> survival
#>              group: <chr> treatment
#>              lower: <NUL> NULL
#>              upper: <NUL> NULL
#>           n_censor: <NUL> NULL
#>             n_risk: <NUL> NULL
#>            show_ci: <lgc> TRUE
#>       show_censors: <lgc> TRUE
#>        show_median: <lgc> TRUE
#>          landmarks: <NUL> NULL
#>         risk_table: <lgc> FALSE
#>         ci_opacity: <nmr> 0.15
#>         line_width: <nmr> 2.00
#>        censor_size: <nmr> 8.00
#>             digits: <int> 3
#>            palette: <NUL> NULL
#>             legend: <lgc> TRUE
#>               xlab: <chr> Time
#>               ylab: <chr> Survival probability
#>