Created
November 9, 2022 15:47
-
-
Save MJacobs1985/4470a3e5c69147a1650281bacfd97390 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qol_combined<-rbind(pan_qol_YN_melt, | |
pan_qol_1_melt, | |
pan_qol_2_melt, | |
pan_qol_3_melt, | |
pan_qol_4_melt, | |
pan_qol_5_melt, | |
pan_qol_6_melt, | |
pan_qol_7_melt, | |
pan_qol_8_melt, | |
pan_qol_9_melt, | |
pan_qol_10_melt, | |
pan_qol_11_melt, | |
pan_qol_12_melt, | |
pan_qol_13_melt, | |
pan_qol_14_melt, | |
pan_qol_15_melt) | |
head(qol_combined) | |
dim(qol_combined) # length = 4320 (16*270) | |
qol_combined<-qol_combined[order(qol_combined$Patientnr),] | |
qol_combined$time<-rep(c(0,1,2,4,5,7,11,19,31), length.out=4320);dim(qol_combined);head(qol_combined) | |
qol_combined %>%dplyr::group_by(variable)%>%skim(.,value) | |
class(qol_combined$variable) | |
levels(qol_combined$variable) | |
qol_combined$variable<-as.character(qol_combined$variable) | |
qol_combined$variable<-strtrim(qol_combined$variable,6) | |
head(qol_combined) | |
try<-qol_combined%>%dplyr::group_by(Patientnr,time)%>%arrange(Patientnr, time);head(try) | |
ggplot(try, aes(x=as.factor(time),y=as.factor(variable),fill=as.factor(value)))+geom_tile(colour="white",size=0.25, na.rm=TRUE)+ | |
labs(x="",y="")+scale_y_discrete(expand=c(0,0))+ | |
scale_fill_viridis(discrete = TRUE, option="magma", direction = -1 )+ | |
facet_wrap(~Patientnr)+ | |
theme_grey(base_size=10)+marc_discrete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment