Spatial Analysis of Crime Data with sf
Build an R script that loads geocoded crime incident data, performs spatial joins with neighborhood boundary shapefiles, and produces choropleth maps of incident density. Learners practice spatial data handling with the sf package, coordinate reference systems, and map visualization.
- Estimate
- ~9h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
sf · ggplot2 · dplyr
Project roadmap
- 01
Load spatial datasets
~2hLoad a shapefile of neighborhood boundaries and a CSV of geocoded incidents with sf, ensuring matching coordinate reference systems.
- 02
Perform a spatial join
~2hJoin incident points to neighborhood polygons to count incidents per neighborhood.
- 03
Compute density metrics
~1.5hNormalize incident counts by neighborhood area or population to compute a density metric.
- 04
Build a choropleth map
~2hVisualize neighborhood-level density with a choropleth map using ggplot2's geom_sf.
- 05
Highlight hotspots
~1.5hIdentify and label the top-N highest-density neighborhoods directly on the map.
Resources
- DocsR Manuals
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack