Fetch and analyze Massachusetts school enrollment, graduation, MCAS assessment, and directory data from the Department of Elementary and Secondary Education (DESE) in R or Python. Over 900,000 students, 400+ districts, 30+ years of enrollment, 19 years of graduation rates, 8 years of MCAS data, and a complete school directory with superintendent and principal contacts.
Part of the njschooldata family.
Full documentation — all 18 stories with interactive charts, getting-started guide, and complete function reference.
Highlights
library(maschooldata)
library(ggplot2)
library(dplyr)
library(scales)
enr <- fetch_enr_multi(2016:2024, use_cache = TRUE)
max_year <- max(enr$end_year)
enr_current <- enr %>% filter(end_year == max_year)
assess_multi <- fetch_assessment_multi(c(2019, 2021, 2022, 2023, 2024, 2025),
use_cache = TRUE)
assess_2025 <- fetch_assessment(2025, use_cache = TRUE)1. MCAS Grade 10 ELA proficiency dropped 10 points since 2019
Massachusetts Grade 10 ELA proficiency dropped from 61% meeting expectations in 2019 to just 51% in 2025 – a 10 percentage point decline. The COVID pandemic disrupted learning, and scores have not recovered.
g10_ela <- assess_multi %>%
filter(is_state, grade == "10", subject == "ela", subgroup == "all")
stopifnot(nrow(g10_ela) > 0)
print(g10_ela %>%
select(end_year, meeting_exceeding_pct, scaled_score, student_count) %>%
mutate(pct_display = paste0(round(meeting_exceeding_pct * 100), "%")))
#> end_year meeting_exceeding_pct scaled_score student_count pct_display
#> 1 2019 0.61 506 70815 61%
#> 2 2021 0.64 507 64305 64%
#> 3 2022 0.58 503 67396 58%
#> 4 2023 0.58 504 70583 58%
#> 5 2024 0.57 504 69975 57%
#> 6 2025 0.51 499 67825 51%
2. COVID crushed kindergarten
Kindergarten enrollment dropped from 66,000 in 2018 to 57,500 in 2021 and has only partially recovered.
k_trend <- enr %>%
filter(is_state, subgroup == "total_enrollment",
grade_level %in% c("K", "01", "06", "12")) %>%
group_by(end_year, grade_level) %>%
slice_max(n_students, n = 1) %>%
ungroup() %>%
mutate(grade_label = case_when(
grade_level == "K" ~ "Kindergarten",
grade_level == "01" ~ "Grade 1",
grade_level == "06" ~ "Grade 6",
grade_level == "12" ~ "Grade 12"
))
stopifnot(nrow(k_trend) > 0)
print(k_trend %>% select(end_year, grade_level, n_students))
#> end_year grade_level n_students
#> 1 2016 01 69606
#> 2 2016 06 71129
#> 3 2016 12 69298
#> 4 2016 K 66024
#> 5 2017 01 68167
#> 6 2017 06 70494
#> 7 2017 12 69397
#> 8 2017 K 66131
#> 9 2018 01 68039
#> 10 2018 06 71262
#> 11 2018 12 69978
#> 12 2018 K 66014
#> 13 2019 01 67590
#> 14 2019 06 72797
#> 15 2019 12 70194
#> 16 2019 K 65944
#> 17 2020 01 67565
#> 18 2020 06 72747
#> 19 2020 12 69373
#> 20 2020 K 65288
#> 21 2021 01 63797
#> 22 2021 06 69383
#> 23 2021 12 70499
#> 24 2021 K 57531
#> 25 2022 01 62602
#> 26 2022 06 67110
#> 27 2022 12 70661
#> 28 2022 K 62374
#> 29 2023 01 65628
#> 30 2023 06 67299
#> 31 2023 12 69134
#> 32 2023 K 61611
#> 33 2024 01 64297
#> 34 2024 06 66913
#> 35 2024 12 68770
#> 36 2024 K 61846
3. Massachusetts is diversifying fast
The state has gone from 62% white in 2016 to 53% in 2024. Hispanic students now make up 25% of enrollment.
demo <- enr %>%
filter(is_state, grade_level == "TOTAL",
subgroup %in% c("white", "black", "hispanic", "asian")) %>%
group_by(end_year, subgroup) %>%
slice_max(n_students, n = 1) %>%
ungroup()
stopifnot(nrow(demo) > 0)
print(demo %>% mutate(pct = round(pct * 100, 1)) %>% select(end_year, subgroup, n_students, pct))
#> end_year subgroup n_students pct
#> 1 2016 asian 61973 6.5
#> 2 2016 black 83902 8.8
#> 3 2016 hispanic 177338 18.6
#> 4 2016 white 597800 62.7
#> 5 2017 asian 63901 6.7
#> 6 2017 black 84884 8.9
#> 7 2017 hispanic 185027 19.4
#> 8 2017 white 584648 61.3
#> 9 2018 asian 65828 6.9
#> 10 2018 black 85863 9.0
#> 11 2018 hispanic 190807 20.0
#> 12 2018 white 573374 60.1
#> 13 2019 asian 66614 7.0
#> 14 2019 black 87550 9.2
#> 15 2019 hispanic 197939 20.8
#> 16 2019 white 561462 59.0
#> 17 2020 asian 67367 7.1
#> 18 2020 black 87292 9.2
#> 19 2020 hispanic 204947 21.6
#> 20 2020 white 549371 57.9
#> 21 2021 asian 65625 7.2
#> 22 2021 black 84766 9.3
#> 23 2021 hispanic 203257 22.3
#> 24 2021 white 516801 56.7
#> 25 2022 asian 65630 7.2
#> 26 2022 black 84772 9.3
#> 27 2022 hispanic 210563 23.1
#> 28 2022 white 507722 55.7
#> 29 2023 asian 66703 7.3
#> 30 2023 black 85891 9.4
#> 31 2023 hispanic 221124 24.2
#> 32 2023 white 497072 54.4
#> 33 2024 asian 67707 7.4
#> 34 2024 black 87836 9.6
#> 35 2024 hispanic 229655 25.1
#> 36 2024 white 484928 53.0
Data Taxonomy
| Category | Years | Function | Details |
|---|---|---|---|
| Enrollment | 1994-2024 |
fetch_enr() / fetch_enr_multi()
|
State, district, school. Race, gender, FRPL, SpEd, LEP |
| Assessments | 2017-2025 |
fetch_assessment() / fetch_assessment_multi()
|
State, district, school. Race, gender, SpEd, LEP, low income |
| Graduation | 2006-2024 |
fetch_graduation() / fetch_graduation_multi()
|
State, district, school. Race, gender, SpEd, LEP, low income |
| Directory | Current | fetch_directory() |
School, district. Address, phone, superintendent, principal |
| Per-Pupil Spending | — | — | — |
| Accountability | — | — | — |
| Chronic Absence | — | — | — |
| EL Progress | — | — | — |
| Special Ed | — | — | — |
See DATA-CATEGORY-TAXONOMY.md for what each category covers.
Quick Start
R
# install.packages("remotes")
remotes::install_github("almartin82/maschooldata")
library(maschooldata)
library(dplyr)
# Fetch one year
enr_2024 <- fetch_enr(2024)
# Fetch multiple years
enr_multi <- fetch_enr_multi(2020:2024)
# State totals
enr_2024 %>%
filter(is_state, subgroup == "total_enrollment", grade_level == "TOTAL")
# District breakdown
enr_2024 %>%
filter(is_district, subgroup == "total_enrollment", grade_level == "TOTAL") %>%
arrange(desc(n_students))
# Boston demographics
enr_2024 %>%
filter(district_id == "0035", grade_level == "TOTAL",
subgroup %in% c("white", "black", "hispanic", "asian")) %>%
select(subgroup, n_students, pct)Python
import pymaschooldata as ma
# Fetch 2024 data (2023-24 school year)
enr = ma.fetch_enr(2024)
# Statewide total
total = enr[(enr['is_state']) & (enr['grade_level'] == 'TOTAL') &
(enr['subgroup'] == 'total_enrollment')]['n_students'].sum()
print(f"{total:,} students")
# Get multiple years
enr_multi = ma.fetch_enr_multi([2020, 2021, 2022, 2023, 2024])
# Check available years
years = ma.get_available_years()
print(f"Data available: {years['min_year']}-{years['max_year']}")
# Fetch graduation rates
grad = ma.fetch_graduation(2024)
# State graduation rate
state_rate = grad[(grad['is_state']) & (grad['subgroup'] == 'all') &
(grad['cohort_type'] == '4-year')]['grad_rate'].values[0]
print(f"State graduation rate: {state_rate * 100:.1f}%")
# Get multiple years of graduation data
grad_multi = ma.fetch_graduation_multi([2020, 2021, 2022, 2023, 2024])
# Fetch MCAS assessment data
assess = ma.fetch_assessment(2025)
# State Grade 10 ELA proficiency
g10_ela = assess[(assess['is_state']) & (assess['grade'] == '10') &
(assess['subject'] == 'ela') & (assess['subgroup'] == 'all')]
print(f"Grade 10 ELA proficiency: {g10_ela['meeting_exceeding_pct'].values[0] * 100:.0f}%")Explore More
- Enrollment trends — 18 stories
- MCAS assessment analysis — 15 stories
- Function reference
Data Notes
Data source: Massachusetts Department of Elementary and Secondary Education (DESE)
Data is accessed via the Massachusetts Education-to-Career Research and Data Hub: - Enrollment: https://educationtocareer.data.mass.gov/d/t8td-gens - Graduation: https://educationtocareer.data.mass.gov/d/n2xa-p822 - Assessment: https://educationtocareer.data.mass.gov/d/i9w6-niyt
Suppression rules: Small counts may be suppressed to protect student privacy.
Economic indicator changes: - Pre-2015: “Low Income” (free/reduced lunch) - 2015-2021: “Economically Disadvantaged” (new definition) - 2022+: “Low Income” (reverted terminology)
Census Day: Data reflects October 1 enrollment counts.
Charter schools: Included with charter flag for filtering. District-level charter totals use special district codes.
Regional districts: Many multi-town districts exist with “Regional” in name, especially for vocational-technical schools.
District IDs: 4-digit codes (e.g., 0035 = Boston, 0281 = Springfield, 0348 = Worcester).
Deeper Dive
4. Boston lost 6,000+ students since 2016
Boston Public Schools enrollment has fallen from over 51,000 in 2016 to under 46,000 in 2024, a decline of more than 6,000 students.
boston <- enr %>%
filter(is_district, district_id == "0035",
subgroup == "total_enrollment", grade_level == "TOTAL")
stopifnot(nrow(boston) > 0)
print(boston %>% select(end_year, district_name, n_students))
#> end_year district_name n_students
#> 1 2016 Boston 53530
#> 2 2017 Boston 53263
#> 3 2018 Boston 52665
#> 4 2019 Boston 51433
#> 5 2020 Boston 50480
#> 6 2021 Boston 48112
#> 7 2022 Boston 46169
#> 8 2023 Boston 46001
#> 9 2024 Boston 45742
5. Gateway Cities under pressure
Springfield, Worcester, and Lowell – Massachusetts’ “Gateway Cities” – show different enrollment trajectories. Springfield has declined while Worcester and Lowell hold relatively steady.
gateway <- enr %>%
filter(is_district, district_id %in% c("0281", "0348", "0160"),
subgroup == "total_enrollment", grade_level == "TOTAL")
stopifnot(nrow(gateway) > 0)
print(gateway %>% select(end_year, district_name, n_students))
#> end_year district_name n_students
#> 1 2016 Lowell 14152
#> 2 2016 Springfield 25479
#> 3 2016 Worcester 25076
#> 4 2017 Lowell 14416
#> 5 2017 Springfield 25633
#> 6 2017 Worcester 25479
#> 7 2018 Lowell 14436
#> 8 2018 Springfield 25604
#> 9 2018 Worcester 25306
#> 10 2019 Lowell 14548
#> 11 2019 Springfield 25297
#> 12 2019 Worcester 25415
#> 13 2020 Lowell 14434
#> 14 2020 Springfield 25007
#> 15 2020 Worcester 25044
#> 16 2021 Lowell 14023
#> 17 2021 Springfield 24239
#> 18 2021 Worcester 23986
#> 19 2022 Lowell 13991
#> 20 2022 Springfield 23799
#> 21 2022 Worcester 23735
#> 22 2023 Lowell 14130
#> 23 2023 Springfield 23721
#> 24 2023 Worcester 24318
#> 25 2024 Lowell 14274
#> 26 2024 Springfield 23693
#> 27 2024 Worcester 24350
6. Cape and Islands enrollment declining
Cape Cod and the Islands have seen declining enrollment as seasonal communities age.
cape <- enr %>%
filter(is_district, grepl("Barnstable|Nauset|Monomoy|Martha|Nantucket", district_name),
subgroup == "total_enrollment", grade_level == "TOTAL") %>%
group_by(end_year) %>%
summarize(n_students = sum(n_students, na.rm = TRUE), .groups = "drop")
stopifnot(nrow(cape) > 0)
print(cape)
#> end_year n_students
#> 1 2016 11041
#> 2 2017 10983
#> 3 2018 10943
#> 4 2019 10974
#> 5 2020 10917
#> 6 2021 10433
#> 7 2022 10423
#> 8 2023 10571
#> 9 2024 10338
7. Charter schools serving 47,000+ students
Massachusetts charter enrollment has grown, with 72 charter campuses enrolling over 47,000 students in 2024.
charter_current <- enr_current %>%
filter(is_charter, is_campus, subgroup == "total_enrollment", grade_level == "TOTAL")
stopifnot(nrow(charter_current) > 0)
print(charter_current %>%
summarize(
total_charter = sum(n_students, na.rm = TRUE),
n_schools = n()
))
#> total_charter n_schools
#> 1 47147 72
8. Over 42% of students are economically disadvantaged
The economically disadvantaged rate jumped from 27% in 2016 to over 43% in 2022, partly due to a definition change.
econ <- enr %>%
filter(is_state, subgroup == "econ_disadv", grade_level == "TOTAL") %>%
group_by(end_year) %>%
slice_max(n_students, n = 1) %>%
ungroup()
stopifnot(nrow(econ) > 0)
print(econ %>% mutate(pct = round(pct * 100, 1)) %>% select(end_year, n_students, pct))
#> end_year n_students pct
#> 1 2016 260998 27.4
#> 2 2017 288465 30.2
#> 3 2018 305203 32.0
#> 4 2019 297120 31.2
#> 5 2020 310873 32.8
#> 6 2021 333843 36.6
#> 7 2022 399140 43.8
#> 8 2023 386060 42.3
#> 9 2024 385697 42.2
9. English learners are concentrated in cities
Phoenix Academy Chelsea and Lowell Community Charter have the highest EL rates, but large urban districts like Lynn and Chelsea serve the most EL students by volume.
el <- enr_current %>%
filter(is_district, subgroup == "lep", grade_level == "TOTAL") %>%
arrange(desc(n_students)) %>%
head(10)
stopifnot(nrow(el) > 0)
print(el %>% mutate(pct = round(pct * 100, 1)) %>% select(district_name, n_students, pct))
#> district_name n_students pct
#> 1 Boston 15408 33.7
#> 2 Worcester 7413 30.4
#> 3 Lynn 6951 43.4
#> 4 Lawrence 5481 42.1
#> 5 Brockton 4648 31.1
#> 6 Lowell 4092 28.7
#> 7 Springfield 4056 17.1
#> 8 Framingham 3407 37.3
#> 9 New Bedford 3211 25.7
#> 10 Everett 3060 41.7
10. Regional districts serve rural Massachusetts
Regional school districts consolidate resources across rural communities. Greater Lowell Voc-Tech leads with over 2,300 students.
regional <- enr_current %>%
filter(is_district, grepl("Regional", district_name),
subgroup == "total_enrollment", grade_level == "TOTAL") %>%
arrange(desc(n_students)) %>%
head(10)
stopifnot(nrow(regional) > 0)
print(regional %>% select(district_name, n_students))
#> district_name n_students
#> 1 Greater Lowell Regional Vocational Technical 2314
#> 2 Greater New Bedford Regional Vocational Technical 2147
#> 3 Greater Lawrence Regional Vocational Technical 1774
#> 4 Monomoy Regional School District 1746
#> 5 Mystic Valley Regional Charter (District) 1653
#> 6 Southeastern Regional Vocational Technical 1597
#> 7 Foxborough Regional Charter (District) 1520
#> 8 Greater Fall River Regional Vocational Technical 1443
#> 9 Montachusett Regional Vocational Technical 1428
#> 10 Northeast Metropolitan Regional Vocational Technical 1343
11. Springfield is 69% Hispanic
Springfield has undergone a dramatic demographic transformation. Hispanic students now make up 69% of enrollment, up from 65% in 2016, while white students have dropped to under 8%.
springfield_demo <- enr %>%
filter(is_district, district_id == "0281", grade_level == "TOTAL",
subgroup %in% c("white", "black", "hispanic", "asian"))
stopifnot(nrow(springfield_demo) > 0)
print(springfield_demo %>% mutate(pct = round(pct * 100, 1)) %>% select(end_year, subgroup, pct))
#> end_year subgroup pct
#> 1 2016 white 12.3
#> 2 2016 black 19.4
#> 3 2016 hispanic 64.5
#> 4 2016 asian 2.5
#> 5 2017 white 11.8
#> 6 2017 black 19.5
#> 7 2017 hispanic 64.8
#> 8 2017 asian 2.4
#> 9 2018 white 11.2
#> 10 2018 black 19.6
#> 11 2018 hispanic 65.0
#> 12 2018 asian 2.4
#> 13 2019 white 10.2
#> 14 2019 black 18.9
#> 15 2019 hispanic 66.6
#> 16 2019 asian 2.3
#> 17 2020 white 9.7
#> 18 2020 black 18.9
#> 19 2020 hispanic 67.1
#> 20 2020 asian 2.1
#> 21 2021 white 9.1
#> 22 2021 black 18.6
#> 23 2021 hispanic 67.9
#> 24 2021 asian 2.1
#> 25 2022 white 8.7
#> 26 2022 black 18.2
#> 27 2022 hispanic 68.3
#> 28 2022 asian 2.0
#> 29 2023 white 8.3
#> 30 2023 black 17.6
#> 31 2023 hispanic 69.0
#> 32 2023 asian 1.8
#> 33 2024 white 7.9
#> 34 2024 black 17.6
#> 35 2024 hispanic 69.3
#> 36 2024 asian 1.7
12. Western MA faces population decline
The Pioneer Valley has seen persistent enrollment declines. Northampton, Amherst, and Pittsfield combined dropped from 9,400 in 2016 to 8,350 in 2024.
# Major Western MA districts
western_ma <- enr %>%
filter(is_district,
district_id %in% c("0210", "0008", "0236"), # Northampton, Amherst, Pittsfield
subgroup == "total_enrollment", grade_level == "TOTAL") %>%
group_by(end_year) %>%
summarize(n_students = sum(n_students, na.rm = TRUE), .groups = "drop")
stopifnot(nrow(western_ma) > 0)
print(western_ma)
#> end_year n_students
#> 1 2016 9447
#> 2 2017 9310
#> 3 2018 9268
#> 4 2019 9186
#> 5 2020 9052
#> 6 2021 8620
#> 7 2022 8624
#> 8 2023 8532
#> 9 2024 8354
13. Special education rates vary widely by district
Some charter and vocational schools have special ed rates above 40%, while the statewide average is around 20%.
sped_by_district <- enr_current %>%
filter(is_district, subgroup == "special_ed", grade_level == "TOTAL") %>%
arrange(desc(pct)) %>%
head(15)
stopifnot(nrow(sped_by_district) > 0)
print(sped_by_district %>% mutate(pct = round(pct * 100, 1)) %>%
select(district_name, n_students, pct))
#> district_name n_students pct
#> 1 Map Academy Charter School (District) 154 55.6
#> 2 Boston Day and Evening Academy Charter (District) 140 47.8
#> 3 Hawlemont 24 42.9
#> 4 Lowell Middlesex Academy Charter (District) 44 41.5
#> 5 Minuteman Regional Vocational Technical 271 39.7
#> 6 Northampton-Smith Vocational Agricultural 214 37.6
#> 7 UP Academy Charter School of Boston (District) 61 36.7
#> 8 Phoenix Academy Public Charter High School, Springfield (District) 55 34.6
#> 9 Rowe 21 34.4
#> 10 Phoenix Academy Public Charter High School, Lawrence (District) 38 33.3
#> 11 Nashoba Valley Regional Vocational Technical 250 32.3
#> 12 Libertas Academy Charter School (District) 166 32.0
#> 13 Boston Green Academy Horace Mann Charter School (District) 145 31.6
#> 14 Holyoke 1527 31.2
#> 15 Tri-County Regional Vocational Technical 298 30.9
14. Four-year graduation rates climbed from 80% to 90%
Massachusetts’ 4-year graduation rate rose from 80% in 2006 to a peak of 90% in 2022 before dipping to 88% in 2024.
grad <- fetch_graduation_multi(2006:2024, use_cache = TRUE)
grad_max_year <- max(grad$end_year)
if (grad_max_year < 2024) {
warning("Graduation data for 2024 unavailable; most recent year is ", grad_max_year)
}
grad_state <- grad %>%
filter(is_state, subgroup == "all", cohort_type == "4-year") %>%
select(end_year, grad_rate, cohort_count) %>%
mutate(rate_pct = round(grad_rate * 100, 1))
stopifnot(nrow(grad_state) > 0)
print(grad_state)
#> end_year grad_rate cohort_count rate_pct
#> 1 2006 0.799 74380 79.9
#> 2 2007 0.809 75912 80.9
#> 3 2008 0.812 77383 81.2
#> 4 2009 0.815 77038 81.5
#> 5 2010 0.821 76308 82.1
#> 6 2011 0.834 74307 83.4
#> 7 2012 0.847 73483 84.7
#> 8 2013 0.850 74537 85.0
#> 9 2014 0.861 73168 86.1
#> 10 2015 0.873 72474 87.3
#> 11 2016 0.875 74045 87.5
#> 12 2017 0.883 73249 88.3
#> 13 2018 0.879 74641 87.9
#> 14 2019 0.880 75067 88.0
#> 15 2020 0.890 74232 89.0
#> 16 2021 0.898 74226 89.8
#> 17 2022 0.901 73901 90.1
#> 18 2023 0.892 72602 89.2
#> 19 2024 0.884 73046 88.4
15. Urban-suburban graduation gaps persist
Boston (80%) trails Newton (95%) by 15 percentage points, reflecting opportunity gaps across the state.
# Use most recent year available from the multi-year fetch
grad_2024 <- grad %>% filter(end_year == grad_max_year)
grad_districts <- grad_2024 %>%
filter(is_district,
district_name %in% c("Boston", "Springfield", "Worcester", "Newton"),
subgroup == "all",
cohort_type == "4-year") %>%
select(district_name, grad_rate, cohort_count) %>%
mutate(rate_pct = round(grad_rate * 100, 1))
stopifnot(nrow(grad_districts) > 0)
print(grad_districts)
#> district_name grad_rate cohort_count rate_pct
#> 1 Boston 0.797 3711 79.7
#> 2 Newton 0.954 963 95.4
#> 3 Springfield 0.786 1841 78.6
#> 4 Worcester 0.860 1990 86.0
16. Special populations face graduation challenges
English learners (67%) and students with disabilities (75%) graduate at lower rates than peers.
grad_special <- grad_2024 %>%
filter(is_state,
subgroup %in% c("all", "english_learner", "special_ed", "low_income"),
cohort_type == "4-year") %>%
select(subgroup, grad_rate, cohort_count) %>%
mutate(rate_pct = round(grad_rate * 100, 1))
stopifnot(nrow(grad_special) > 0)
print(grad_special)
#> subgroup grad_rate cohort_count rate_pct
#> 1 all 0.884 73046 88.4
#> 2 special_ed 0.754 15039 75.4
#> 3 low_income 0.816 39276 81.6
#> 4 english_learner 0.667 7194 66.7
17. Math fared worse than ELA post-pandemic
Math scores dropped more severely than ELA. In 2019, 59% of Grade 10 students met expectations in math. By 2025, only 45% did.
state_subjects <- assess_multi %>%
filter(is_state, grade == "10", subgroup == "all",
subject %in% c("ela", "math"))
stopifnot(nrow(state_subjects) > 0)
print(state_subjects %>%
select(end_year, subject, meeting_exceeding_pct) %>%
tidyr::pivot_wider(names_from = subject, values_from = meeting_exceeding_pct) %>%
mutate(ela_pct = paste0(round(ela * 100), "%"),
math_pct = paste0(round(math * 100), "%")))
18. English Learners face a 40-point gap
Only 5% of English Learners met expectations in Grade 10 Math compared to 45% of all students – a 40 percentage point gap. This is the largest achievement gap in Massachusetts.
el_gap <- assess_2025 %>%
filter(is_state, grade == "10", subject == "math",
subgroup %in% c("all", "english_learner", "special_ed", "low_income"))
stopifnot(nrow(el_gap) > 0)
print(el_gap %>%
select(subgroup, meeting_exceeding_pct, student_count) %>%
arrange(desc(meeting_exceeding_pct)) %>%
mutate(pct_display = paste0(round(meeting_exceeding_pct * 100), "%")))
#> subgroup meeting_exceeding_pct student_count pct_display
#> 1 all 0.45 67096 45%
#> 2 low_income 0.24 27828 24%
#> 3 special_ed 0.12 12512 12%
#> 4 english_learner 0.05 5724 5%