I would like to add lines between \"mean\" in my boxplot.
My code:
library(ggplot2)
library(ggthemes)
Gp=factor(c(rep(\"G1\",80),rep(\"G2\",80)))
Fc=fac
Here's an alternative:
DATA$U <- paste(X, Z) # Extra interaction
qplot(U, Y, data = DATA, geom = "boxplot", fill = Z, na.rm = TRUE,
outlier.size = NA, outlier.colour = NA) +
facet_grid(Gp ~ Fc) + theme_light() + scale_colour_gdocs() +
theme(legend.position = "bottom") +
stat_summary(fun.y = mean, geom = "point", shape = 23, position = position_dodge(width = .75)) +
stat_summary(fun.y = mean, geom = "line", aes(group = X)) + # Lines
scale_x_discrete(labels = rep(levels(X), each = 2)) + xlab("X") # Some fixes