From 4dc7d39da0cdc4f23e984fcce517e0a0c1ca33f9 Mon Sep 17 00:00:00 2001 From: Tobias Fellinger Date: Wed, 19 Aug 2020 13:39:25 +0200 Subject: [PATCH] Fix Bug in ggcompetingrisks.cuminc Fix Bug #490 by adding correct group aesthetics to the ggplot-object, when using a single panel, grouping and confidence intervalls. --- R/ggcompetingrisks.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ggcompetingrisks.R b/R/ggcompetingrisks.R index 36662f8..ef5bff0 100644 --- a/R/ggcompetingrisks.R +++ b/R/ggcompetingrisks.R @@ -89,7 +89,7 @@ ggcompetingrisks.cuminc <- function(fit, gnames = NULL, gsep=" ", if (multiple_panels) { pl <- ggplot(df, aes(time, est, color=event)) + facet_wrap(~group) } else { - pl <- ggplot(df, aes(time, est, color=event, linetype=group)) + pl <- ggplot(df, aes(time, est, color=event, linetype=group, group=interaction(group, event))) } if (conf.int) { pl <- pl + geom_ribbon(aes(ymin = est - coef*std, ymax=est + coef*std, fill = event), alpha = 0.2, linetype=0)