I would like to change the point denoting the mean in ggerrorplot
to a horizontal line (similar to the line used to denote a median in a boxplot). I would like this line to be slightly thicker than the error bars.
I do not see an option to do so in the ggerrorplot
documentation. Will I need to do some hacking and perhaps overlay a line outside of ggerrorplot
?
# ToothGrowth data set available in R datasets
df <- ToothGrowth
# Examine first 10 rows
head(df, 10)
# len supp dose
# 1 4.2 VC 0.5
# 2 11.5 VC 0.5
# 3 7.3 VC 0.5
# 4 5.8 VC 0.5
# 5 6.4 VC 0.5
# 6 10.0 VC 0.5
# 7 11.2 VC 0.5
# 8 11.2 VC 0.5
# 9 5.2 VC 0.5
# 10 7.0 VC 0.5
require(ggpubr)
# Add mean, jitter points and error bars
ggerrorplot(df, x = "dose", y = "len",
add = c("mean","jitter"), error.plot= "errorbar")