'GGplot is drawing the wrong y axis for 'counts' in histogram

 ggplot(data.frame(dat<-round(rnorm(1000),2)),aes(dat)) +
 geom_freqpoly()+ geom_point(aes(x=-0.78,
 y=sum(dat==-0.78)),colour="red",shape=18,size=6)

I drew this plot and when i checked how many times -0.78 occurs by using sum(dat==-0.78) , it said it occurs 3 times. But according to the plot -0.78 occurs more than 50 times(the y axis is counts). This seems wrong to me. The following is the plot. If the number occurs 3 times in my data then why does my plot say it occurs more than 50 times?

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source