Been scouring the site (and others) for a solution to the problem pictured below. I can't get the error bars to move from their 'low' position, despite trying lots of different solutions to similar problems I have encountered here and elsewhere.
The problem occurs whether I produce one graph alone or the two and combine them with gridExtra.
Here is the code and a sample of each dataset included:
First dataset example:
Group PSQI Time_Point
1 Control 2 Baseline
2 Control 2 Baseline
3 Control 2 Baseline
4 Control 13 Baseline
5 Control 1 Baseline
6 Control 7 Baseline
Second:
Group ESS Time_Point
1 Control 3 Baseline
2 Control 4 Baseline
3 Control 1 Baseline
4 Control 0 Baseline
5 Control 7 Baseline
6 Control 11 Baseline
Code:
library(gridExtra)
library(ggplot2)
library(grid)
p1 <- ggplot(PSQI_Graph,aes(fill=Group,y=PSQI,x=Time_Point)) +
geom_bar(position="dodge",stat="identity", width = 0.50) +
stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position =
position_dodge(.5), width = .25)+
guides(fill = F)+
scale_y_continuous(name = "Mean PSQI Score", limits=c(0,25))+
xlab("Time Point") +
guides(fill = guide_legend(keywidth = 1.5, keyheight = 1))+
theme_bw()
Would really like to get this data out, so would appreciate any suggestions.

