Description Usage Arguments Examples
Each polygon is cut between the points of the polygons that are closest to pt1 and pt2
1 | cut_sppoly(sppoly, pt1, pt2)
|
sppoly |
A Polygon object as defined the sp package. |
pt1 |
A single-point SpatialPoint object as defined in the sp package. |
pt2 |
A single-point SpatialPoint object as defined in the sp package. |
1 2 3 4 5 6 7 8 | library(sf)
# SpatialPolygonsDataFrame
vn <- sf::as_Spatial(gadmVN::gadm(level = "province"))
# SpatialPoints
stations <- as(imhen::stations, "Spatial")
stations <- df2splist(as.data.frame(stations@coords))
cut_sppoly(vn, stations[[1]], stations[[2]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.