[英]Add a line to survminer survival plot
I have the following survival curve 我的生存曲线如下
require("survival")
library(survminer)
fit <- survfit(Surv(time, status) ~ 1, data = lung)
ggsurvplot(fit, palette = "jco",risk.table = TRUE)
I would like to add to the plot the non-straight line with x time=c(0,100, 200, 300, 500, 750)
and y surv=c(1, 0.99, 0.95, 0.92, 0.88, 0.82)
我想将x
time=c(0,100, 200, 300, 500, 750)
和y surv=c(1, 0.99, 0.95, 0.92, 0.88, 0.82)
time=c(0,100, 200, 300, 500, 750)
的非直线添加到图中
How can I do that? 我怎样才能做到这一点?
I think you're looking for the geom_curve() OR geom_segment() argument - you'll have to specify the type of curve, but it's certainly one option for adding a customized line to your ggplot. 我认为您正在寻找geom_curve()或geom_segment()参数-您必须指定曲线的类型,但这肯定是向ggplot添加自定义线的一种选择。
Here's more: https://ggplot2.tidyverse.org/reference/geom_segment.html 这里是更多: https : //ggplot2.tidyverse.org/reference/geom_segment.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.