I am creating a ggplot with the below code:
a <- ggplot(zscoregraph[which(zscoregraph$Grouping=="ER" | zscoregraph$Grouping=="Admission" | zscoregraph$Grouping=="ICU"),],aes(x=name,y=mean, color=Grouping, group=Grouping)) +
stat_summary(fun=mean,geom="point", size=5) +
stat_summary(fun=mean,aes(group=Grouping),geom="line",size=1.5, linetype = "solid") +
geom_hline(yintercept = 0, linetype = "dashed", colour="black")+
xlab("Test") + ylab("Z-Score")+
theme_classic() +
labs(title = "Outcomes") +
theme(axis.text.x = element_text(angle = 90)) +
scale_x_discrete(labels= labs)
b <- a+ geom_errorbar(aes(ymin=LL, ymax=UL), width = .2, colour="black") + scale_colour_manual(values = c("darkgoldenrod", "black", "cadetblue"))
I was wanting to add a jitter so the geom points + errorrbar are slightly offset to allow for easy of reading.
I was wondering if anyone may be able to advise?