h_ggkm | R Documentation |
Draw the Kaplan-Meier plot using ggplot2
.
h_ggkm(
data,
xticks = NULL,
yval = "Survival",
censor_show,
xlab,
ylab,
ylim = NULL,
title,
footnotes = NULL,
max_time = NULL,
lwd = 1,
lty = NULL,
pch = 3,
size = 2,
col = NULL,
ci_ribbon = FALSE,
ggtheme = nestcolor::theme_nest()
)
data |
( |
xticks |
( |
yval |
( |
censor_show |
( |
xlab |
( |
ylab |
( |
ylim |
( |
title |
( |
footnotes |
( |
max_time |
( |
lwd |
( |
lty |
( |
pch |
( |
size |
( |
col |
( |
ci_ribbon |
( |
ggtheme |
( |
A ggplot
object.
library(dplyr)
library(survival)
fit_km <- tern_ex_adtte %>%
filter(PARAMCD == "OS") %>%
survfit(formula = 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",
yval = "Survival",
ylab = "Survival Probability",
title = "Survival"
)
gg
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.