The enrollment counts come from Tennessee Department of Education district profiles. The 2024–25 workbook identifies its totals as K–12 enrollment. Grade coverage and reporting practices may vary across earlier years. District records with missing counts are excluded from the rankings.
Choose a school year to see the five largest districts’ home counties on the map and the ten largest districts by reported enrollment in the bar chart. Two ranked districts may share a county. The map uses 2024 county boundaries for geographic reference, and the counts describe individual school districts.
District records with reported enrollment: 140 of 140.
| District | County | Enrollment |
|---|---|---|
| Memphis | Shelby | 108,433 |
| Davidson County | Davidson | 75,100 |
| Knox County | Knox | 56,788 |
| Shelby County | Shelby | 48,243 |
| Hamilton County | Hamilton | 41,831 |
District records with reported enrollment: 139 of 140.
| District | County | Enrollment |
|---|---|---|
| Memphis | Shelby | 113,571 |
| Davidson County | Davidson | 81,003 |
| Knox County | Knox | 57,639 |
| Shelby County | Shelby | 47,297 |
| Hamilton County | Hamilton | 44,372 |
District records with reported enrollment: 140 of 141.
| District | County | Enrollment |
|---|---|---|
| Memphis | Shelby | 109,262 |
| Davidson County | Davidson | 78,975 |
| Knox County | Knox | 57,505 |
| Shelby County | Shelby | 45,705 |
| Hamilton County | Hamilton | 42,892 |
District records with reported enrollment: 140 of 141.
| District | County | Enrollment |
|---|---|---|
| Memphis - old | Shelby | 106,991 |
| Davidson County | Davidson | 81,134 |
| Knox County | Knox | 58,940 |
| Shelby County - old | Shelby | 46,601 |
| Hamilton County | Hamilton | 43,691 |
District records with reported enrollment: 140 of 140.
| District | County | Enrollment |
|---|---|---|
| Shelby County | Shelby | 149,928 |
| Davidson County | Davidson | 82,806 |
| Knox County | Knox | 59,232 |
| Hamilton County | Hamilton | 43,531 |
| Rutherford County | Rutherford | 41,497 |
District records with reported enrollment: 146 of 146.
| District | County | Enrollment |
|---|---|---|
| Shelby County | Shelby | 116,059 |
| Davidson County | Davidson | 84,070 |
| Knox County | Knox | 59,750 |
| Hamilton County | Hamilton | 43,797 |
| Rutherford County | Rutherford | 41,901 |
District records with reported enrollment: 146 of 146.
| District | County | Enrollment |
|---|---|---|
| Shelby County | Shelby | 112,077 |
| Davidson County | Davidson | 85,123 |
| Knox County | Knox | 60,313 |
| Hamilton County | Hamilton | 44,414 |
| Rutherford County | Rutherford | 43,099 |
District records with reported enrollment: 146 of 146.
| District | County | Enrollment |
|---|---|---|
| Shelby County | Shelby | 109,664 |
| Davidson County | Davidson | 85,453 |
| Knox County | Knox | 60,356 |
| Hamilton County | Hamilton | 44,444 |
| Rutherford County | Rutherford | 44,067 |
District records with reported enrollment: 145 of 145.
| District | County | Enrollment |
|---|---|---|
| Shelby County Schools | Shelby | 106,381 |
| Metro Nashville Public Schools | Davidson | 82,424 |
| Knox County Schools | Knox | 59,364 |
| Rutherford County Schools | Rutherford | 44,707 |
| Hamilton County Schools | Hamilton | 43,830 |
District records with reported enrollment: 146 of 146.
| District | County | Enrollment |
|---|---|---|
| Shelby County Schools | Shelby | 106,377 |
| Metro Nashville Public Schools | Davidson | 81,407 |
| Knox County Schools | Knox | 59,224 |
| Rutherford County Schools | Rutherford | 45,579 |
| Hamilton County Schools | Hamilton | 44,376 |
District records with reported enrollment: 147 of 147.
| District | County | Enrollment |
|---|---|---|
| Shelby County | Shelby | 107,272 |
| Metro Nashville Public Schools | Davidson | 82,214 |
| Knox County | Knox | 59,880 |
| Rutherford County | Rutherford | 46,827 |
| Hamilton County | Hamilton | 44,248 |
District records with reported enrollment: 147 of 148.
| District | County | Enrollment |
|---|---|---|
| Shelby County | Shelby | 106,988 |
| Metro Nashville Public Schools | Davidson | 78,224 |
| Knox County | Knox | 57,991 |
| Rutherford County | Rutherford | 46,544 |
| Hamilton County | Hamilton | 43,273 |
District records with reported enrollment: 147 of 148.
| District | County | Enrollment |
|---|---|---|
| Memphis-Shelby County Schools | Shelby | 102,221 |
| Metro Nashville Public Schools | Davidson | 77,479 |
| Knox County | Knox | 58,873 |
| Rutherford County | Rutherford | 48,669 |
| Hamilton County | Hamilton | 44,186 |
District records with reported enrollment: 147 of 148.
| District | County | Enrollment |
|---|---|---|
| Memphis-Shelby County Schools | Shelby | 104,944 |
| Metro Nashville Public Schools | Davidson | 77,435 |
| Knox County | Knox | 58,879 |
| Rutherford County | Rutherford | 50,026 |
| Hamilton County | Hamilton | 44,845 |
District records with reported enrollment: 147 of 148.
| District | County | Enrollment |
|---|---|---|
| Memphis-Shelby County Schools | Shelby | 105,202 |
| Metro Nashville Public Schools | Davidson | 77,334 |
| Knox County | Knox | 58,838 |
| Rutherford County | Rutherford | 50,737 |
| Hamilton County | Hamilton | 44,765 |
District records with reported enrollment: 148 of 149.
| District | County | Enrollment |
|---|---|---|
| Memphis-Shelby County Schools | Shelby | 105,856 |
| Metro Nashville Public Schools | Davidson | 78,040 |
| Knox County | Knox | 58,329 |
| Rutherford County | Rutherford | 51,318 |
| Hamilton County | Hamilton | 44,855 |
library(ggplot2)
library(sf)
csv <- path.expand(params$enrollment_csv)
if (!file.exists(csv)) {
stop(
"Run the enrollment extraction script first, ",
"or update enrollment_csv in the report header.",
call. = FALSE
)
}
districts <- read.csv(csv, colClasses = c(district_id = "character"))
options(tigris_use_cache = TRUE)
counties <- tigris::counties(
state = "TN",
cb = TRUE,
year = 2024,
progress_bar = FALSE
)
fmt <- scales::label_comma()
years <- sort(unique(districts$year))
labels <- districts$school_year[match(years, districts$year)]
# Match historical district names to their home counties.
locations <- c(
"Memphis" = "Shelby",
"Memphis - old" = "Shelby",
"Shelby County" = "Shelby",
"Shelby County - old" = "Shelby",
"Shelby County Schools" = "Shelby",
"Memphis-Shelby County Schools" = "Shelby",
"Davidson County" = "Davidson",
"Metro Nashville Public Schools" = "Davidson",
"Knox County" = "Knox",
"Knox County Schools" = "Knox",
"Rutherford County" = "Rutherford",
"Rutherford County Schools" = "Rutherford",
"Hamilton County" = "Hamilton",
"Hamilton County Schools" = "Hamilton"
)
tags <- htmltools::tags
# Embed each figure in the HTML report.
image_tag <- function(plot, height, alt) {
path <- tempfile(fileext = ".png")
on.exit(unlink(path))
ggsave(
filename = path,
plot = plot,
width = 8.5,
height = height,
dpi = 120,
bg = "white"
)
tags$img(
src = base64enc::dataURI(file = path, mime = "image/png"),
alt = alt,
style = "width:100%;height:auto"
)
}
# Build the map, bar chart, and summary for each school year.
panels <- lapply(seq_along(years), function(i) {
year <- years[i]
records <- districts[districts$year == year, ]
ranked <- records[is.finite(records$profile_enrollment), ]
ranked <- ranked[order(-ranked$profile_enrollment, ranked$district), ]
top_five <- head(ranked, 5)
top_five$county <- unname(locations[top_five$district])
stopifnot(
nrow(ranked) >= 10L,
all(top_five$county %in% counties$NAME)
)
# Map the home counties of the five largest districts.
highlighted <- counties[counties$NAME %in% top_five$county, ]
map <- ggplot() +
geom_sf(
data = counties,
fill = "#e8eef1",
color = "white",
linewidth = 0.25
) +
geom_sf(
data = highlighted,
fill = "#17657b",
color = "white",
linewidth = 0.3
) +
coord_sf(crs = st_crs(5070), datum = NA) +
labs(title = "Home counties of the five largest districts") +
theme_void(base_size = 13)
# Put the largest district at the top of the horizontal bar chart.
top_ten <- head(ranked, 10)
top_ten$label <- factor(top_ten$district, levels = rev(top_ten$district))
bars <- ggplot(top_ten, aes(profile_enrollment, label)) +
geom_col(fill = "#17657b") +
geom_text(
aes(label = fmt(profile_enrollment)),
hjust = -0.12,
size = 3.3
) +
scale_x_continuous(
labels = fmt,
expand = expansion(mult = c(0, 0.19))
) +
labs(
title = "Ten largest districts by reported enrollment",
x = "Students enrolled",
y = NULL
) +
theme_minimal(base_size = 12) +
theme(panel.grid.major.y = element_blank())
key <- data.frame(
District = top_five$district,
County = top_five$county,
Enrollment = fmt(top_five$profile_enrollment)
)
tags$section(
id = paste0("year-", year),
class = "enrollment-panel",
hidden = if (i != length(years)) "hidden",
tags$h3(labels[i]),
tags$p(sprintf(
"District records with reported enrollment: %d of %d.",
nrow(ranked),
nrow(records)
)),
image_tag(map, 3.2, paste("Tennessee county map for", labels[i])),
htmltools::HTML(as.character(knitr::kable(key, format = "html"))),
image_tag(bars, 5.4, paste("District enrollment ranking for", labels[i]))
)
})
# Select the latest school year when the report opens.
picker <- tags$select(
id = "school-year",
lapply(seq_along(years), function(i) {
tags$option(
value = years[i],
selected = if (i == length(years)) "selected",
labels[i]
)
})
)
cat(as.character(htmltools::tagList(
tags$style(".enrollment-panel[hidden] { display: none !important; }"),
tags$p(tags$label(`for` = "school-year", "School year "), picker),
panels,
tags$script(htmltools::HTML("
(function () {
var picker = document.getElementById('school-year');
function updateYear() {
document.querySelectorAll('.enrollment-panel').forEach(function(panel) {
panel.hidden = panel.id !== 'year-' + picker.value;
});
}
picker.addEventListener('change', updateYear);
updateYear();
}());
"))
)))