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) (You and Wood 2006; You, Wood, and Wood-Sichra 2009;
You et al. 2014; Yu et al. 2020) in R (Dijk et al. 2023). 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
(Wickham et al. 2019) 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 (Pebesma 2018) is a package to process spatial data in vector (polygon) format.
terra package (Hijmans 2022) 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.