kassambara / survminer

Survival Analysis and Visualization
https://rpkgs.datanovia.com/survminer/
504 stars 162 forks source link

Extending ggsurvplot() Capabilities #201

Closed kassambara closed 7 years ago

kassambara commented 7 years ago

Capabilities of the current version:

New features to be added:

fit <- survfit(Surv() ~ treatmeent)
ggsurvplot(fit, group.by = "tp53.mutation")

Returns a list of ggsurplots. One can (optionally) arrange ggsurvplots using arrange_ggsurvplots()

pfs <- survfit( Surv(pfs.time, pfs.status) ~ 1, data = data)
os <- survfit( Surv(os.time, os.status) ~ 1, data = data)
fit <- list(PFS = pfs, OS = os)
ggsurvplot(fit, combine = TRUE)
kassambara commented 7 years ago

The new ggsurvplot function would look like this:

ggsurvplot(fit, data, color = NULL, palette = NULL, group.by = NULL, 
    facet.by = NULL, combine = NULL, add.all = NULL, .....){

    if(is.list(fit))
      ggsurvplot_list(fit,  data...)
      else if(!is.null(group.by))
      ggsurv_plot(fit, data, group.by, ...)
      .......

    }

To keep things simple, we need a family of ggsurvplot functions:

These functions will be internally called by the main function ggsurvplot() depending on the situation.

Other small functions needed:

kassambara commented 7 years ago

We need a more generic function surv_plot(), that will be a wrapper around the ggsurvplot_*() family functions.

The final list would be:

1. For visualization:

2. For fitting and describing

kassambara commented 7 years ago

ggsurvplot() help page reorganized and new functions added: New functions added: