I have a data of student scores. I want to get the number of students who scored in particular marks intervals. Here in the sample data, the scores range from 1 to 20. I want to create an intervals of 0-5,6-10,11-15,16-20 (this interval can depend on the situation at hand). How can I do this?
library(tidyverse) data<-tibble::tribble( ~score, 6L, 19L, 10L, 1L, 9L, 4L, 6L, 4L, 20L, 5L, 6L, 17L, 4L, 2L, 17L, 3L, 9L, 13L, 1L ) ggplot(data,aes(score))+ geom_bar(fill="orange")+ theme_minimal() Created on 2022-09-21 by the reprex package (v2.0.1)