-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
People occasionally ask about plotting survival curves with ggplot2. While it is possible, see here for some examples, it's not done in the "ggplot way" and people often revert to the base plot because it's so much easier (but not nearly as powerful).
I've worked a bit on adding a stat and geom for computing and plotting survival curves here. I view it as along the same lines as stat_ecdf
but for censored data. Before submitting a pull request I wanted to ask if this would be suitable for inclusion in ggplot2, or if it would be better as a standalone package?
Here's an example code and plot:
df <- survival::lung
ggplot(df, aes(x = time, status = status, color = factor(sex))) + geom_km()
pe-perry
Metadata
Metadata
Assignees
Labels
No labels