My dataset has 3 columns: high school name, year, and percent enrolled in college, and it includes 104 high schools across 8 years.
school | chrt_grad | enrolled |
---|---|---|
Alba | 2012 | 0.486 |
Alba | 2013 | 0.593 |
Alba | 2014 | 0.588 |
Alba | 2015 | 0.588 |
Alba | 2016 | 0.547 |
Alba | 2017 | 0.613 |
Alba | 2018 | 0.622 |
Alba | 2019 | 0.599 |
Alba | 2020 | 0.614 |
City | 2012 | 0.588 |
City | 2013 | 0.613 |
and so on...
I'm trying to produce 104 individual line plots--one for each school. I started by creating a single line plot showing every school:
ggplot(nsc_enroll,
mapping = aes(x = chrt_grad, y = enrolled, group = school)) +
geom_line() +
geom_point()
How can I create an individual plot for each of the 104 schools without having to filter for each school name over and over again?