I am trying to create a raincloud plot with a 95% confidence interval, however my code keeps on produces a raincloud plot with a boxplot interval. Meaning the black circle is the median not the mean. How can I change my code to add in error bars to achieve this?
Here are two codes I tried that create the raincloud plot, but no with the mean. I have attached how the plots look. The last image is how I want the plot to look. ")
Can be found here:
https://z3tt.github.io/Rainclouds/
ggplot(iris, aes(Species, Sepal.Width)) + ggdist::stat_halfeye(adjust = .5, width = .3, .width = c(0.5, 1)) + ggdist::stat_dots(side = "left", dotsize = .4, justification = 1.05, binwidth = .1)
Thanks for updating your question with a minimal reproducible example. One potential 'easy' solution is to add the mean to the existing plot:
Created on 2023-03-02 with reprex v2.0.2
If this doesn't suit, I suspect you need to calculate the statistics yourself, e.g.
Created on 2023-03-07 with reprex v2.0.2