sd_neighbor_map {edbuildmapr} | R Documentation |
This function allows you to create a map of any school district with its neighbors symbolized by a selected variable.
sd_neighbor_map(data_year = "2019", school_district = NULL,
map_var = "Student Poverty", legend= TRUE, type = "like")
data_year |
Four digit year of master data to pull in. Options include 2013- 2019. Defaults to 2019. |
school_district |
Seven digit NCESID of the school district. Default is NULL. |
map_var |
Variable by which to symbolize the map.
Defaults to |
legend |
If TRUE, legend is visible. Defaults to TRUE. |
type |
Indicate which types of neighbors to return. Defaults to "like", returning a map of neighbors of the same district type (unified to unified, elementary to elementary and secondary to secondary). To view all neighbors use "all". This becomes important for districts like Chicago which have upwards of 50 neighboring school districts, but only 1 type-like neighbor. Chicago is a unified district with 1 unified neighbor, 16 secondary neighbors, and 32 elementary neighbors. |
An image of the map which can be written out with
tmap::tmap_save(map, '~/Documents/map.png')
map <- sd_neighbor_map(data_year = "2019", school_district = "2901000", "Percent Nonwhite")