Hi, I have been trying to code for a histogram with groups that include the mean value for each group on the plot using geom_point() but keep getting the error "stat_summary requires the following missing aesthetics: y". I would greatly appreciate some help in understanding what is happening here. Thanks in advance.

code used:

fin2.2 <- finch%>%select(Species,WingL,BodyL)

sppf<-factor(finch[,1])

ggplot(fin2.2, aes(x=WingL,fill=Species, color=Species)) +

geom_histogram(position="identity",bins=20, alpha=0.5)+

scale_fill_manual(values=c("red","grey","green","purple","cyan"))+

labs(title= "Histogram of wing lengths in finches",x="Wing lengths (mm)", y = "Frequency")+

geom_point() +

stat_summary(geom = "point", fun = "mean", colour = "sppf", size = 2.0)