I am trying to place the number of observations inside the bin like this [Excel histogram example][1]: https://i.stack.imgur.com/kYJt7.png.
But now i run into the problem that i need to reproduce this in Rstudio. I'm able to plot all the histograms i need but can't seem to visualise the exact amount inside a bin.
An example of the code is use is:
WPTD3 %>% filter(Date==44935) %>% ggplot(aes(x=PerpDist)) + geom_histogram(binwidth = 5,boundary=0)+xlab('Perpendicular Distance')+ylab('Observations')+ggtitle('TD3 Sampling 2 WP - Perpendicular Observation frequency')+scale_y_continuous(breaks = pretty_breaks(5))+scale_x_continuous(breaks = pretty_breaks(10))
Is there a way to code this or is this an exclusive feature to Excel?