Arguments
- data
(
data.frame
)
survival data as pre-processed byh_data_plot
.- g_el
(
list
ofgtable
)
list as obtained byh_decompose_gg()
.- title
(
string
)
title for plot.- footnotes
(
string
)
footnotes for plot.- annot_at_risk
(
flag
)
compute and add the annotation table reporting the number of patient at risk matching the main grid of the Kaplan-Meier curve.
Details
The layout corresponds to a grid of two columns and five rows of unequal dimensions. Most of the dimension are fixed, only the curve is flexible and will accommodate with the remaining free space.
The left column gets the annotation of the
ggplot
(y-axis) and the names of the strata for the patient at risk tabulation. The main constraint is about the width of the columns which must allow the writing of the strata name.The right column receive the
ggplot
, the legend, the x-axis and the patient at risk table.
Examples
if (FALSE) {
library(scda)
library(dplyr)
library(survival)
fit_km <- synthetic_cdisc_data("latest")$adtte %>%
filter(PARAMCD == "OS") %>%
survfit(form = Surv(AVAL, 1 - CNSR) ~ ARMCD, data = .)
data_plot <- h_data_plot(fit_km = fit_km)
xticks <- h_xticks(data = data_plot)
gg <- h_ggkm(
data = data_plot,
censor_show = TRUE,
xticks = xticks, xlab = "Days", ylab = "Survival Probability",
title = "tt", footnotes = "ff", yval = "Survival"
)
g_el <- h_decompose_gg(gg)
lyt <- h_km_layout(data = data_plot, g_el = g_el, title = "t", footnotes = "f")
grid.show.layout(lyt)
}