This project visualizes Durham Fire Stations by battalion on a map using R. The map is generated from a CSV file containing station names, battalion numbers, and physical addresses. Each station is geocoded to latitude and longitude, and battalion areas are highlighted with convex hulls for clarity.
Durham-Fire-Stations/
β
ββ addresses_to_geocode.csv # CSV file with station names, battalion, and addresses
ββ Durham_Fire_Stations_Map.png # Output map generated by the R script
ββ Fire_Stations_Geocoded.csv # Output geocoded station addresses
ββ Data_Cleaning.R # Main R script
ββ README.md # Project documentation
- R (β₯ 4.5.0)
- Install the following R packages:
install.packages(c("tidygeocoder", "dplyr", "sf", "ggplot2", "tigris", "ggrepel"))The CSV file addresses_to_geocode.csv should include the following columns:
| Station | Battalion | Physical Location |
|---|---|---|
| Station 1 | 1 | 139 E. Morgan Street Durham, NC 27701 |
| Station 2 | 1 | 1001 9th Street Durham, NC 27705 |
| ... | ... | ... |
- County Boundary: Displays Durham County.
- Fire Stations: Points colored by battalion for quick identification.
- Battalion Areas: Highlighted using convex hulls to delineate coverage areas.
- Station Labels: Short form (
S1, S2β¦) for a clean visual.
- Geocoding is performed using OpenStreetMap via
tidygeocoder; optionally,method = "arcgis"can be used.