
Get largest (e.g. mainland) polygons from a map
[social4i size="small" align="align-left"]
-->
[This article was first published on modTools, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I often need to get mainland from country / administrative region polygons, so I finally decided to write a function to help automate it. It selects the N largest feature(s) in a polygons or lines map. Here’s the code:
selectLargest <- function(x, # terra SpatVector polygons or lines n = 1, # number of largest…
The skinny
The skinny isn't ready yet — notes appear once the transcript is processed.