View source: R/clusterOutputToTerraVector.R
clusterOutputToTerraVector | R Documentation |
Enriches land use data on cluster resolution with explicit spatial information by creating a terra polygon for each cluster according to the given clustermap.
clusterOutputToTerraVector(x, clustermap)
x |
Landuse data on cluster/cell resolution as a magclass object |
clustermap |
A dataframe mapping with columns cluster, cell, and country |
A SpatVector with the following columns: c("clusterId", "country", "region", "year", "landtype", "value")
Pascal Führlich, Patrick v. Jeetze
## Not run:
landUse <- magpie4::land("fulldata.gdx", level = "cell")
clustermap <- readRDS(Sys.glob("clustermap_*.rds"))
clusterPolygons <- magpie4::clusterOutputToTerraVector(landUse, clustermap)
terra::writeVector(clusterPolygons, "cluster_resolution.shp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.