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

changing proportion picture to risk table #33

Closed
Feli-Anna opened this issue Mar 29, 2016 · 7 comments
Closed

changing proportion picture to risk table #33

Feli-Anna opened this issue Mar 29, 2016 · 7 comments

Comments

@Feli-Anna
Copy link

Hi again,

sorry for bringing up all these issues here, but since ggplot was updated, my code is pretty much messed up and it is really hard to fix it.

Before, the proportion of my plot to risk table was pretty nice. You could clearly see if curves cross or not.

first line specific survival

Using the same code now, I get approximately this:

first line.

I have to hand in a report very soon and I plottet my curves with the pre-updated version, but I made some mistakes (which I can't fix now after the update....).
I'd appreciate some suggestions to fix this :)

Thanks
Feli

@kassambara
Copy link
Owner

Hi,

I think that you don't have the latest version of survminer installed on your computer.

  • Remove the current version:
remove.packages("survminer")
  • Install the latest version from GitHub
if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/survminer")
  • Use survminer
# Fit survival curves
require("survival")
fit <- survfit( Surv(time, status) ~ rx + adhere,
                data = colon )

# Visualize
library("survminer")
ggsurvplot(fit, pval = TRUE,
          risk.table = TRUE,
          risk.table.col = "strata",
          main = "Survival Curves",
          risk.table.height = 0.3, # Useful when you have multiple groups
)

You should have the following plot:

rplot

devtools::session_info("survminer")
Session info ----------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.2.3 (2015-12-10)
 system   x86_64, darwin13.4.0        
 ui       RStudio (0.99.491)          
 language (EN)                        
 collate  fr_FR.UTF-8                 
 tz       Europe/Paris                
 date     2016-03-29                  
Packages --------------------------------------------------------------------------------------------------------------
 package      * version    date       source                               
 colorspace     1.2-6      2015-03-11 CRAN (R 3.2.0)                       
 dichromat      2.0-0      2013-01-24 CRAN (R 3.2.0)                       
 digest         0.6.9      2016-01-08 CRAN (R 3.2.3)                       
 ggplot2      * 2.1.0      2016-03-01 CRAN (R 3.2.4)                       
 gridExtra      2.2.1      2016-02-29 CRAN (R 3.2.4)                       
 gtable         0.2.0      2016-02-26 CRAN (R 3.2.3)                       
 labeling       0.3        2014-08-23 CRAN (R 3.2.0)                       
 magrittr       1.5        2014-11-22 CRAN (R 3.2.0)                       
 MASS           7.3-45     2015-11-10 CRAN (R 3.2.3)                       
 munsell        0.4.3      2016-02-13 CRAN (R 3.2.3)                       
 plyr           1.8.3      2015-06-12 CRAN (R 3.2.0)                       
 RColorBrewer   1.1-2      2014-12-07 CRAN (R 3.2.0)                       
 Rcpp           0.12.4     2016-03-26 CRAN (R 3.2.4)                       
 reshape2       1.4.1      2014-12-06 CRAN (R 3.2.0)                       
 scales         0.4.0      2016-02-26 CRAN (R 3.2.3)                       
 stringi        1.0-1      2015-10-22 CRAN (R 3.2.0)                       
 stringr        1.0.0      2015-04-30 CRAN (R 3.2.0)                       
 survival     * 2.38-3     2015-07-02 CRAN (R 3.2.3)                       
 survminer    * 0.2.0.9002 2016-03-29 Github (kassambara/survminer@3e9cb1f)

Best regards,
AK

@Feli-Anna
Copy link
Author

I did as you said.

Now I have this

rplot01f

Still, the proportions don't fit.....

@MarcinKosinski
Copy link
Contributor

@Feli-Anna have your tried writing your image to pdf file?

require("survival")
fit <- survfit( Surv(time, status) ~ rx + adhere,
                data = colon )

# Visualize
library("survminer")
pdf("file.pdf", width = 15, height = 15)
ggsurvplot(fit, pval = TRUE,
          risk.table = TRUE,
          risk.table.col = "strata",
          main = "Survival Curves",
          risk.table.height = 0.3, # Useful when you have multiple groups
)
dev.off()

More over are you using zoom in RStudio to have better view of the plots that are not saved to pdf file?

@MarcinKosinski
Copy link
Contributor

@Feli-Anna ?

@MarcinKosinski
Copy link
Contributor

@kassambara it's been over 75 days since this request.
Are we closing this issue with won't fix or can't reproduce (or even solved)?

@kassambara
Copy link
Owner

As we didn't receive any request from other users about such issue, we can assume that this problem is solved with the current version of survminer.

@MarcinKosinski
Copy link
Contributor

I can't close this. No read/write rights and it's not mine issue. You are the only one who can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants