Skip to content

Customizing ggcuminc graphs with ggsurvfit #138

Answered by ddsjoberg
eloccodes asked this question in Q&A
Discussion options

You must be logged in to vote

The code from the gallery works for me:

library(ggsurvfit)
#> Loading required package: ggplot2
library(tidycmprsk)

cuminc(Surv(ttdeath, death_cr) ~ trt, trial) %>%
  ggcuminc(outcome = "death from cancer") +
  add_confidence_interval() +
  add_censor_mark() +
  add_risktable() +
  theme_bw() +
  scale_ggsurvfit(x = list(breaks = seq(0, 24, by = 6))) +
  scale_color_manual(values = c('#54738E', '#82AC7C')) +
  scale_fill_manual(values = c('#54738E', '#82AC7C'))

Created on 2022-12-28 with reprex v2.0.2

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@eloccodes
Comment options

Comment options

You must be logged in to vote
1 reply
@ddsjoberg
Comment options

Answer selected by ddsjoberg
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@saskia-c
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants