Turns the cells of chosen classes of a categorical raster into polygons,
e.g. Mediterranean and arid Koppen-Geiger climates to test how much M
changes without them (pass the result to exclude in delimit_m() or
m_scenarios()).
Examples
r <- terra::rast(nrows = 10, ncols = 10, vals = rep(1:2, 50))
class_polygons(r, 2)
#> Simple feature collection with 1 feature and 0 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -144 ymin: -90 xmax: 180 ymax: 90
#> Geodetic CRS: WGS 84 (CRS84)
#> geometry
#> 1 MULTIPOLYGON (((-108 -90, -...
