我的数据(305行)是这样的:
邮编 | 龙 | lat |
---|---|---|
13112 | 43.10306 | -76.41926 |
13140 | 43.05891 | -76.65841 |
14456 | 42.84584 | -77.00012 |
我想将这些坐标绘制为美国州级地图的点: 我正在使用美国州级 shapefile 来自:https://www2.census.gov/geo/tiger/TIGER_RD18/LAYER/STATE/
数据 match_zip 包含我的点的 lon/lat,us_shape 是我的 shapefile。 我正在地理编码并绘制地图上没有显示的点:
coordinates(match_zip) = c("lat","lng")
crs.geo1 = CRS("+proj=longlat")
proj4string(match_zip) = crs.geo1
plot(us_shape)
points(match_zip, pch = 20, col = "orange")