Comments (7)
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:
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
from survminer.
I did as you said.
Now I have this
Still, the proportions don't fit.....
from survminer.
@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?
from survminer.
from survminer.
@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
)?
from survminer.
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.
from survminer.
I can't close this. No read/write rights and it's not mine issue. You are the only one who can close this.
from survminer.
Related Issues (20)
- select_()` was deprecated in dplyr 0.7.0. ℹ Please use `select()` instead.
- Error in xtfrm.data.frame(x) : cannot xtfrm data frames when using ggadjustedcurves
- Adding the 'hjust' argument to line 293 in the 'ggsurvtable.R' file
- Argument event is not working in ggadjustedcurves and surv_adjustedcurves
- cox
- surv_cutpoint when NA survival outcomes exist
- how to retain the confidence interval in plot when try to transform it to plotly object
- `ggsurvplot_facet()` says it supports numeric/text input to `pval` argument, but it doesn't.
- Deprecated functions HOT 1
- ggsurvplot displaying error
- Log Likelihood Ratio P-value incorrectly named as log-rank?
- Number at risk and number censored in the same table using ggsurvplot_combine
- Changing size of "large dash". HOT 1
- surv.median.line triggers warnings in ggplot2 3.5.0 HOT 2
- `surv_fit` doesn't support `weights` parameter
- deprecated feature in survminer
- ggsurvplot gives error when drawing risk table. HOT 3
- pariwise_survdiff throws unusual error when a model with strata is used
- misalignment between the chart and the risk table in ggsurvplot HOT 6
- ggflexsurvplot risk table strata
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survminer.