I'm running the survival analysis in R from the following tutorial: https://www.emilyzabor.com/tutorials/survival_analysis_in_r_tutorial.html#Part_1:_Introduction_to_Survival_Analysis
I got an error while running the following lines of code to get Kaplan-Meier plots.
survfit2(Surv(time, status) ~ 1, data = lung) %>%
ggsurvfit() +
labs(
x = "Days",
y = "Overall survival probability"
)
Error in ggsurvfit(.) : could not find function "ggsurvfit"
Could anyone help me figure out how to fix the error? I'd appreciate it!