Plots contextual landmark Kaplan-Meier curves. An extension of the 'survminer::ggsurvplot()' function that allows the specification of a landmark time and an optional label. The period before the landmark is displayed as a pooled survival curve, while curves beyond the landmark are presented according to the groups defined in the supplied 'survival::survfit' object.
The goal of landmarked is to plot survival curves for time-to-event data adjusted for a specified landmark time. You can use your existing survminer::ggsurvplot code and specify the landmark time and label.
You can install the landmarked from CRAN with:
install.packages("landmarked")
You can install the development version of landmarked from GitHub with:
# install.packages("pak")
pak::pak("CStats/landmarked")
This is a basic example which shows you how to plot an adjusted landmark curve.
library(landmarked)
fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung)
ggsurvplotlm(fit, landmark_time = 42, landmark_label = "Landmark Time")