[R-sig-Geo] Merging Shape files

El Mechry El Koudouss ee|koudou@@ @end|ng |rom |ordh@m@edu
Tue Mar 17 15:27:56 CET 2020


Dear readers,
I downloaded a shapefile with data on crime incidents in Washington DC in
2016 (available here:
https://opendata.dc.gov/datasets/crime-incidents-in-2016) and another
shapefile with data on parks and recreation areas, also in Washington DC
(available here: https://opendata.dc.gov/datasets/parks-and-recreation-areas).
I was able to read both shapefiles using st_read() from the sf package. My
question is, how can I merge the two data sets? I tried st_join() but it
simply resulted in empty columns from the parks dataset getting added to
the crime data. Any guidance would be much appreciated.
library(sf)
parks <- st_read("Parks_and_Recreation_Areas.shp")
crime <- st_read("Crime_Incidents_in_2016.shp")
df <- st_join(crime, parks)

-- 
El Mechry, El Koudouss (Meshry)
Graduate Research Assistant
Center for International Policy Studies
Fordham University
Department of Economics
Website: www.meshry.com

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list