Description Usage Arguments Examples
Convert a Spatial polygon into a list of Spatial polygons
1 | as_list(plgn)
|
plgn |
a SpatialPolygon* |
1 2 3 4 5 6 7 8 9 10 | library(sf)
# download vietnam admin1 administrative map in the internal library and in
# the working direction
vn <- sptools::gadm("vietnam", "sf", 1, intlib = TRUE, save = TRUE)
provinces <- as(vn["VARNAME_1"], "Spatial")
class(provinces)
list_provinces <- as_list(provinces)
class(list_provinces)
table(sapply(list_provinces, class))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.