knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
To run mapspam2globiom
, you need to install several several R packages and GAMS.
Several R packages are required to run mapspam2globiom
:
mapspamc. This packages implements the Spatial Production Allocation Model (SPAM) [@You2006; @You2009; @You2014a; @Yu2020] in R [@VanDijk2023]. The ouput are a set of crop distribution maps that are used as input in the mapspam2globiom
package.
To interface between R and GAMS the gdxrrw package is required. Unfortunately, this package is not available on CRAN and therefore has to be installed manually. The package can be found here, which also presents instructions on how to install the package. Several functions in mapspamc
use gdxrrw to read and save GAMS gdx files and check whether the package and GAMS are installed.
tidyverse [@Wickham2019] is the name for a set of packages that work in harmony to facilitate data preparation and processing, most importantly dplyr, purrr, tidyr and ggplot2. Some of them are used by mapspamc
and will be installed automatically when the package is installed for the first time and were not installed before.
sf package [@Pebesma2018] is a package to process spatial data in vector (polygon) format.
terra package [@Hijmans2022] is a package to process spatial data in raster format.
mapspam2globiom
creates several GAMS gdx files for which GAMS is required. GAMS is a modelling system and language designed for mathematical optimization. The GAMS system and solvers can be downloaded from the GAMS website.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.