── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(janitor)
Attaching package: 'janitor'
The following objects are masked from 'package:stats':
chisq.test, fisher.test
library(scales)
Attaching package: 'scales'
The following object is masked from 'package:purrr':
discard
The following object is masked from 'package:readr':
col_factor
library(DT)
Import
I am importing the cleaned data.
# Importing the clean datasped <-read_rds("data-processed/01-sped.rds")sped |>head()
Data takeaway: The statewide percentage of special education students has increased from 8.6% in 2013 to 12.9% in 2023.
Districts by benchmark and year
How many districts were above that arbitrary 8.5% benchmark before and after the changes?
I am counting districts by the audit flag.
flag_count_districts <- sped |>count(year, audit_flag, name ="count_districts")
I am building the first exploratory chart.
flag_count_districts |>ggplot(aes(x = year, y = count_districts, fill = audit_flag)) +geom_col()
I am building the grouped column version.
flag_count_districts |>ggplot(aes(x = year, y = count_districts, fill = audit_flag)) +geom_col(position ="dodge")
Now, I am visualizing as a line.
flag_count_districts |>ggplot(aes(x = year, y = count_districts, group = audit_flag)) +geom_line(aes(color = audit_flag)) +ylim(0,1000)
Data takeaway: Before the change, there were about 600 districts above the arbitrary 8.5% benchmark. After the change, the number grew to almost 1,000 districts in 2023.
Local districts
How have local districts changed?
sped |>head()
I am looking at local districts.
# Bastropsped |>filter(cntyname =="BASTROP") |>ggplot(aes(x = year, y = sped_percent, group = distname)) +geom_line(aes(color = distname)) +geom_point(aes(color = distname))
Data takeaway: The percentages of special education students in Bastrop county school districts have increased since the change.
Now I am doing the same for the other three counties, each in their own code chunk: Hays, Travis and Williamson.
# Hayssped |>filter(cntyname =="HAYS") |>ggplot(aes(x = year, y = sped_percent, group = distname)) +geom_line(aes(color = distname)) +geom_point(aes(color = distname))
Data takeaway: The percentages of special education students in Hays county school districts have increased since the change.
# Travissped |>filter(cntyname =="TRAVIS") |>ggplot(aes(x = year, y = sped_percent, group = distname)) +geom_line(aes(color = distname)) +geom_point(aes(color = distname))
Data takeaway: The percentages of special education students in Travis county school districts have increased since the change.
# Williamsonsped |>filter(cntyname =="WILLIAMSON") |>ggplot(aes(x = year, y = sped_percent, group = distname)) +geom_line(aes(color = distname)) +geom_point(aes(color = distname))
Data takeaway: The percentages of special education students in Williamson county school districts have increased since the change.
Exporting
I am exporting my data for Datawrapper.
# Exporting my data for Datawrapperyearly_percent |>write_csv("data-processed/yearly_percent.csv")