I have a dataset of people's birth-year. I want to plot a histogram, but since I am working with a fairly large dataset I would like to group my data in classes of 5. For example, there are 30 people born in the year 1985 but in my histogram I want it to show me that the frequency is 6.
This is the code I have so far for my histogram.
ggplot(date, aes(date$year)) +
geom_histogram(colour = "black") +
labs(title = "...", x = "year", y = "frequency")