如何抑制ggplot累积入射曲线上的置信区间?

时间:2018-12-19 08:44:45

标签: r ggplot2

我正在密谋cumulative incidence curves for competing risks

ggcompetingrisks (cmprsk_cuminc, # http://www.sthda.com/english/rpkgs/survminer/reference/ggcompetingrisks.html
                                 conf.int = TRUE,
                                 xlab = "Time in years",
                                 ylab = "Cumulative Incidence",
                                 xlim = c(0, 5),
                                 break.time.by = 10,
                                 fontsize = 5,
                                 #ggtheme = theme_bw(),
                                 font.main = 18,
                                 font.x =  16,
                                 font.y = 16,
                                 font.tickslab = 12,
                                 palette = c("green", "blue", "red"))

Cumulative Incidence Curves for Competing Risks

但是,当我想使用命令

删除曲线的置信区间时
...conf.int = FALSE,...

我收到以下错误消息:

Error in ggcompetingrisks(cmprsk_cuminc_gender, conf.int = TRUE, xlab = "Time in years",  : 
  formal argument "conf.int" matched by multiple actual arguments.

关于如何抑制置信区间的任何想法?

谢谢

1 个答案:

答案 0 :(得分:0)

该错误来自选项conf.int在两个单独的未引起注意的地方写入了两次。以下工作正常。

ggcompetingrisks (cmprsk_cuminc_gender, xlab = "Time in years", 
                                        ylab = "Cumulative Incidence",
                                        xlim = c(0, 5),
                                        break.time.by = 10,
                                        fontsize = 5,
                                        #ggtheme = theme_bw(),
                                        font.main = 18,
                                        font.x =  16,
                                        font.y = 16,
                                        font.tickslab = 12,
                                        palette = c("green", "blue", "red"),
                                        multiple_panels = FALSE,
                                        conf.int = FALSE)

Cumulative Incidence Curves for Competing Risks without confidence intervalls

经验教训:请始终仔细检查代码。