Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Should xlim be in coord_cartesian mode? #4
@kassambara Thanks for your great work in creating survminer.
resul$plot <- resul$plot + scale_x_continuous() resul$table <- resul$table + scale_x_continuous()
I assume the only situation in which a user would like to cut axes is when there exists a specific time point after which there are only few patients. Like on the example below
library(RTCGA) # survivalTCGA is github only function library(RTCGA.clinical) library(survminer) library(survival) survivalTCGA(BRCA.clinical, OV.clinical, extract.cols = "admin.disease_code") -> BRCAOV.survInfo fit <- survfit(Surv(times, patient.vital_status)~admin.disease_code, data = BRCAOV.survInfo) # Customize the output and then print #++++++++++++++++++++++++++++++++++++ ggsurvplot(fit, pval = TRUE, conf.int = TRUE, risk.table = TRUE)
In such situation one might not be interested in time below 2000 days. So He would like to provide a limits for xlim and use
ggsurvplot(fit, pval = TRUE, conf.int = TRUE, risk.table = TRUE, xlim = c(0,200))
Careful R user might notice the error
Warning messages: 1: Removed 1005 rows containing missing values (geom_path). 2: Removed 710 rows containing missing values (geom_point). 3: Removed 1 rows containing missing values (geom_text). 4: Removed 6 rows containing missing values (geom_text).
and might notice that the graph does not correspond to the previous one.
What have happened is that: first the rows with higer survival times were removed, and then the survival curves where calculated. Which is not the real issue. One would like to still get the smae survival estimates. So I think the
ggsurvplot(fit, pval = TRUE, conf.int = TRUE, risk.table = TRUE) -> res res$plot <- res$plot + coord_cartesian(xlim = c(0,2000)) res$table <- res$table + coord_cartesian(xlim = c(0,2000)) res
Which has the same survival curves as the first graph, but it looks like the risk table is broken.
This is the issue I have also when woking with the
I changed xlim to Cartesian Coordinates mode, which is the most common type of coordinate system. It will zoom the plot, without clipping the data.
By default, ggsurvplot adds the exact value of the pvalue when pval = TRUE.
I've been to few oncological conference and people rather had p < 0.0001
2016-02-14 10:17 GMT+01:00 Alboukadel KASSAMBARA email@example.com: