I have the following code to generate the plot of the Figure 1 A :

ggplot2(GroupedZScoreFatigue, aes (x = factor(Moment, levels = c("MD-4", "MD-3", "MD-2", "MD-1", "MD", "MD+1", "MD+2")), y = Mean, group = Athlete))+

geom_line(size= 0.2)+

geom_point(size = 2)+

ylab("Fatigue (x̄±σ)")+

xlab("Moment")+

ggtitle("Individual Z-Score Variations - Fatigue")+

theme_classic(base_size = 12)+

theme (legend.position = "None", plot.title = element_text(hjust = 0.5))+

ylim(-2,4)

I want to add a new line to the plot based on the mean of Mean (variable in y axis) for each Moment (variable in x axis), however when i add stat_summary(fun.y=mean, colour="blue", geom="line", size= 0.2) to the code it calculate the mean for each Athlete (variable in group), as shown in Figure 1B. Data may be downloaded here: GroupedZScoreFatigue.xlsx

How to solve it? Thank you!