Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facet survival curves into multiple panels #205

kassambara opened this Issue Apr 28, 2017 · 3 comments


None yet
3 participants
Copy link

kassambara commented Apr 28, 2017

No description provided.


This comment has been minimized.

Copy link
Owner Author

kassambara commented Apr 28, 2017

New option added now in ggsurvplot() to draw multi-panel survival curves of a data set grouped by one or two variables. Alias of the ggsurvplot_facet() function.

Load required packages


Compute survival curves

fit1 <- survfit( Surv(time, status) ~ sex, data = colon )

fit2 <- survfit( Surv(time, status) ~ sex + rx, data = colon )

Facet by one grouping variables

Facet by the treatment assignment rx

# Faceting fit 1
ggsurvplot(fit1, colon, = "rx", 
              palette = "jco", pval = TRUE)


# Faceting fit 2
ggsurvplot(fit2, colon, = "adhere", 
           palette = "jco", pval = TRUE)


Facet by two grouping variables

ggsurvplot(fit1, colon, = c("rx", "adhere"),
           palette = "jco", pval = TRUE)



This comment has been minimized.

Copy link

jiajiaybyb commented Jan 14, 2019

I realized ggsurvplot_facet does not plot the survival lines all the way to 100%, is there a solution for this? Ideally I would like to have facet panels, with corresponding p values and survival tables in the output. Any recommend method for this? Thanks a lot!


This comment has been minimized.

Copy link

Yatros commented Apr 11, 2019


Is it possible to add capability to ggsurvplot_facet() so that it accepts as input not only survfit objects, but also a list of survfit objects?

ggsurvplot() accepts already survfit lists.

Thank you very much,

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.