Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Last active November 9, 2022 16:24
Show Gist options
  • Save MJacobs1985/a83af94dd47ec4d51a70e640553eb028 to your computer and use it in GitHub Desktop.
Save MJacobs1985/a83af94dd47ec4d51a70e640553eb028 to your computer and use it in GitHub Desktop.
g1<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek))+ geom_density(color="darkblue", fill="lightblue")+theme_bw()
g2<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=Performance_status_at_consultation))+
geom_density(alpha=0.5)+theme_bw()
g3<-ggplot(total[!total$Patientnr==8, ],aes(x=SurvTimeWeek, fill=Gender))+
geom_density(alpha=0.5)+theme_bw()
g4<-ggplot(total[!total$Patientnr==8, ],aes(x=SurvTimeWeek, fill=Disease_stage_at_consultation))+
geom_density(alpha=0.5)+theme_bw()
g5<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=Surgery_prior_to_consultation))+
geom_density(alpha=0.5)+theme_bw()
g6<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=Chemotherapy_prior_to_consultation))+
geom_density(alpha=0.5)+theme_bw()
g7<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=as.factor(Opioid_YN)))+
geom_density(alpha=0.5)+theme_bw()
g8<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=Non_opioid_spec))+
geom_density(alpha=0.5)+theme_bw()
g9<-ggplot(total[!total$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=Tumorsite_in_pancreas))+
geom_density(alpha=0.5)+theme_bw()
g10<-ggplot(pancreas[!pancreas$Patientnr==8, ],
aes(x=SurvTimeWeek, fill=Opioid_spec))+
geom_density(alpha=0.5)+theme_bw()
grid.arrange(g1,g2,g3,g4,g5,g6,g7,g8,g9,g10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment