Package 'landmarked'

Title: Plot Adjusted Kaplan-Meier Estimates from a Landmark Time
Description: 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.
Authors: Chris Brown [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-2506-4871>)
Maintainer: Chris Brown <[email protected]>
License: GPL (>= 3)
Version: 0.2.0
Built: 2026-10-16 09:06:06 UTC
Source: https://github.com/cstats/landmarked

Help Index


Recreate a dataset from a survfit object

Description

Recreate a dataset from a survfit object

Usage

dataset_from_survfit(fit)

Arguments

fit

A survfit object from the 'survival' package.

Value

The data.frame with variables: time, status, and strata (if applicable).

Examples

fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung)
dataset_from_survfit(fit)

Plot and adjusted Kaplan-Meier curve accounting for landmark analysis

Description

Plot and adjusted Kaplan-Meier curve accounting for landmark analysis

Usage

ggsurvplotlm(fit, landmark_time = 6, landmark_label = "Landmark Time", ...)

Arguments

fit

A survfit object from the 'survival' package.

landmark_time

The time at which to perform the landmark analysis

landmark_label

The label to use for the landmark time in the plot

...

Additional arguments passed to [survminer::ggsurvplot()].

Value

The modified ggsurvplot object.

Examples

fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung)
ggsurvplotlm(fit, landmark_time = 70, landmark_label = "Landmark Time",axes.offset=FALSE)