sd_neighbor_map {edbuildmapr} | R Documentation |
A function to create a map of a school district and its neighbors
Description
This function allows you to create a map of any school district with its neighbors symbolized by a selected variable.
Usage
sd_neighbor_map(data_year = "2019", school_district = NULL,
map_var = "Student Poverty", legend= TRUE, type = "like")
Arguments
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. |
Value
An image of the map which can be written out with
tmap::tmap_save(map, '~/Documents/map.png')
See Also
Examples
map <- sd_neighbor_map(data_year = "2019", school_district = "2901000", "Percent Nonwhite")