
上QQ阅读APP看书,第一时间看更新
Adding point data on polygon data
Now, we will plot point data on polygon data. For doing so, we will first plot SpatialPolygonsDataFrame (containing polygons) and then will add SpatialPointsDataFrame (containing points) using points(). We do so in the following way:
# Adding point data on polygon data
plot(map_bd)
points(bd_val, pch=19, col="blue")
This gives us the following map where points are overlaid on the polygon: