With version 3.7-0, the survival packages offers a data.frame = TRUE option to summary.survfit(). This means we can use that directly instead of doing the conversion to a data frame ourselves. We'll still need to get it into a nested tibble eventually and take care of rows in new_data with missing values but it would simplify the code nonetheless.
With version 3.7-0, the survival packages offers a
data.frame = TRUE
option tosummary.survfit()
. This means we can use that directly instead of doing the conversion to a data frame ourselves. We'll still need to get it into a nested tibble eventually and take care of rows innew_data
with missing values but it would simplify the code nonetheless.Created on 2024-06-12 with reprex v2.1.0