I have made a cumulative incidence plot using cmprsk::cuminc
and then ggcompetingrisks
for plotting.
I want to change legend labels for the group.
I've tried with legend.lab = c("A", "B", "C")
.
This works when I do a ggsurvplot
without competing risk. But it does not work now.
Any suggestions?
My code is like:
fit <- cuminc(df$Time, df$Event, group = df$genotype)
p <- ggcompetingrisks(fit, multiple_panels = FALSE, palette = "black",
legend.title = c("genotype"),
legend.labs = c("A", "B", "C"))
The thing is that the legend show both the Event (0, 1) and the Group (1, 2, 3). I want only the group to be shown in the legend and I want it to be named A, B and C..
Please help me!!