Error in add median survival line to ggsurvplot

I trying add median survival line to my plot(by using argument surv.median.line), and get the same error. What is wrong?
ggsurvplot(fit, pval = FALSE, = FALSE, legend.title = "Sleep status", legend.labs = c("Good", "Bad"), risk.table = TRUE, risk.table.y.text.col = TRUE, ggtheme = theme_classic(), palette = c("Black", "Black"), linetype = "strata", censor = FALSE, ylab ="Percent Survival", xlab ="Time(months)", fun=function(y)100*y, ylim=c(0,100), surv.median.line = "hv")

That what I get:

'Error in match(x, table, nomatch = 0L) : 
  'match' requires vector arguments'

I also asked in

If you poke around the source code, it looks like survminer:::.add_surv_median() isn't compatible with arbitrary functions. In your case, however, you can change the fun argument to fun = 'pct'.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.