Research Tool Explained

Here is how we built the map application:

  • The California State Geoportal was consulted to merge the school board data with geographic boundaries data for school districts in California. 

  • The Geoportal has shapefiles with school district boundary data from 2017-18 until the 2023-24 school year. We downloaded the respective shapefiles as geoJSON files to be subsequently used in R to map characteristics across the school districts. The shapefiles were read by using the sf package. We then merged them with the school board data by year using the join functions from the dplyr package. 

  • It should be noted that in some instances, we had duplicate school district names; to accommodate the joining of the data in these cases, county names were subsequently added by hand to the school board CSV file. 

  • Then, we used an inner join to join the geographic data to the school board data without duplicate names and a right join to join the subset with duplicate names. Subsequently, rbind was used to bind both subsets row-wise to create one final data object per year that contains the geographic boundaries, demographic and academic information provided by the state, and finally, the school board information that we have compiled so far. 

  • It should also be noted that a significant number of districts are still missing from the school board data, so when the merged data are mapped, some portions of the data remain empty.

  • With the data preparation complete, the data are loaded into a shiny app via the SF package. The app has a simple layout that allows the user to select school district type, year, and a numeric variable to compare across districts. After filtering the dataset, the app renders an interactive leaflet map that color codes the map as a choropleth, highlighting the differences among the school districts based on the selected variable.