You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ability to select theme of ggplot using ggtheme() argument in ggsurvplot() function.
Actual behavior
No theme change with input.
Steps to reproduce the problem
# Split this data (explained below)colon.sex0<-colon[!(colon$sex%in%1), ]
colon.sex1<-colon[!(colon$sex%in%0), ]
# Create Kaplan-Maier and Cox Proportional Hazard estimate where sex = 0sex0.kaplan<- survfit(Surv(time, status) ~sex, data=colon.sex0)
sex0.cox<- survfit(coxph(Surv(time, status) ~sex, data=colon.sex0))
# Make a list for comparisonsex0.fits<-list(Kaplan=sex0.kaplan, Cox=sex0.cox)
# Same, but where sex = 1sex1.kaplan<- survfit(Surv(time, status) ~sex, data=colon.sex1)
sex1.cox<- survfit(coxph(Surv(time, status) ~sex, data=colon.sex1))
# Make a list for comparisonsex1.fits<-list(Kaplan=sex1.kaplan, Cox=sex1.cox)
# Compare allall.fits<-list(Kaplan.0=sex0.kaplan, Cox.0=sex0.cox, Kaplan.1=sex1.kaplan, Cox.1=sex1.cox)
# Plotsggsurv.sex0<- ggsurvplot(sex0.fits, fun="event", ggtheme= theme_gray(), conf.int=TRUE, legend="right", combine=TRUE, linetype= c(1, 2), palette="strata", censor=FALSE)
sex0.plot<-ggsurv.sex0+ ggtitle("THIS IS NOT theme_gray()") + labs(subtitle="but I wish it was...", x="TIME", y="CDF")
ggsurv.sex1<- ggsurvplot(sex1.fits, fun="event", ggtheme= theme_dark(), conf.int=TRUE, legend="right", combine=TRUE, linetype= c(1, 2), palette="strata", censor=FALSE)
sex1.plot<-ggsurv.sex1+ ggtitle("THIS IS NOT theme_dark()") + labs(subtitle="but I wish it was...", x="TIME", y="CDF")
ggsurv.all<- ggsurvplot(all.fits, fun="event", ggtheme= theme_void(), conf.int=TRUE, legend="right", combine=TRUE, linetype= c(1, 2, 1, 2), palette="strata", censor=FALSE)
all.plot<-ggsurv.all+ ggtitle("THIS IS NOT theme_void()") + labs(subtitle="but I wish it was...", x="TIME", y="CDF")
Should Be theme_gray
Should Be theme_dark
Should Be theme_void
The reason I separate the colon data is because when I run
# Again, create Kaplan-Maier and Cox Proportional Hazard estimates but using all datakaplan.sex<- survfit(Surv(time, status) ~sex, data=colon)
cox.sex<- survfit(coxph(Surv(time, status) ~sex, data=colon))
# Make list for comparisonfits.sex<-list(sex.km=kaplan.sex, sex.cox=cox.sex)
It creates an undesired result of creating cox estimate for all the data (when I would like to see separate estimates).
# Plotggsurv.sex<- ggsurvplot(fits.sex, colon, fun="event", conf.int=TRUE, legend="right", palette= c("jco"), combine=TRUE, linetype= c(1,2,3))
sex.plot<-ggsurv.sex+ ggtitle("THIS IS NOT WHAT I WANTED") + labs(subtitle="but I wish it was...", x="TIME", y="CDF")
Expected behavior
Ability to select theme of ggplot using ggtheme() argument in ggsurvplot() function.
Actual behavior
No theme change with input.
Steps to reproduce the problem
The reason I separate the colon data is because when I run
It creates an undesired result of creating cox estimate for all the data (when I would like to see separate estimates).
Awesome package by the way =D
-jim
session_info()
#204
The text was updated successfully, but these errors were encountered: