Convert cluster output to terra vector
Source:R/clusterOutputToTerraVector.R
clusterOutputToTerraVector.RdEnriches land use data on cluster resolution with explicit spatial information by creating a terra polygon for each cluster according to the given clustermap.
Value
A SpatVector with the following columns: c("clusterId", "country", "region", "year", "landtype", "value")
See also
Other Spatial:
addGeometry(),
gdxAggregate(),
mappingToLongFormat(),
superAggregateX()
Examples
if (FALSE) { # \dontrun{
landUse <- magpie4::land("fulldata.gdx", level = "cell")
clustermap <- readRDS(Sys.glob("clustermap_*.rds"))
clusterPolygons <- magpie4::clusterOutputToTerraVector(landUse, clustermap)
terra::writeVector(clusterPolygons, "cluster_resolution.shp")
} # }