0

I want to plot the first layer with all the actual data point with circles, and the second layer with mean value using diamonds. I have my fist layer as follows:

ggplot(daphnia, aes(x = parasite, y = growth.rate, color = parasite)) +
geom_point(size = 4) +
theme_bw() +
coord_flip()

which part should modify to add on the second layer? I have calculated the mean for each group and stored it in the data frame sumDat.

It should look like this: enter image description here

Ocras
  • 3
  • 2
  • It would be easier to help you if you provide a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). But you could add a second layer like so `geom_point(data = sumDat, aes(parasite, MEAN), shape = "diamond")` – stefan Feb 05 '21 at 17:57
  • also `stat_summary(fun = mean, pch=2)` would work – pascal Feb 05 '21 at 17:58

0 Answers0