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",
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.
- title
Optional Character: Chart title.
- dat_path
Optional Character: Path to the data, read at draw time. The serializable alternative to passing
datatodraw().- 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)#> <rtemis.draw::SurvivalConfig>
#> @ type : chr "survival"
#> @ dat_path : NULL
#> @ title : NULL
#> @ origin : Named chr [1:24] "default" "default" "default" "default" "default" ...
#> .. - attr(*, "names")= chr [1:24] "dat_path" "title" "legend_position" "legend_placement" ...
#> @ writer : NULL
#> @ legend_position : chr "top"
#> @ legend_placement: chr "outside"
#> @ time : chr "time"
#> @ survival : chr "survival"
#> @ group : chr "treatment"
#> @ lower : NULL
#> @ upper : NULL
#> @ n_censor : NULL
#> @ n_risk : NULL
#> @ show_ci : logi TRUE
#> @ show_censors : logi TRUE
#> @ show_median : logi TRUE
#> @ landmarks : NULL
#> @ risk_table : logi FALSE
#> @ ci_opacity : num 0.15
#> @ line_width : num 2
#> @ censor_size : num 8
#> @ digits : int 3
#> @ palette : NULL
#> @ legend : logi TRUE
#> @ xlab : chr "Time"
#> @ ylab : chr "Survival probability"