Displaying 1 result from an estimated 1 matches for "st_cast".
Did you mean:
r_cast
2024 May 17
0
[External] Re: Removing polygons from shapefile of Scotland and Islands
Scotland is the second feature in the UK data, so get it and split this one
MULTIPOLYGON feature into individual POLYGONS
scot = st_cast(the_uk$geometry[2],"POLYGON")
# which is the largest polygon?
which.max(st_area(scot))
[1] 1
# the first one. ok...
plot(scot[[1]]) # mainland
# add the rest of the islands for context, in grey, maybe to show they're
outside our study area:
for(i in 2:length(scot)){plot(scot[[i]]...