spam_par
sets all required parameters for spam to run, including core model
folders, country code, year, spatial resolution, availability of subnational
statistics, solve level, type of model and location of GAMS.
spam_par(
spam_path = NULL,
raw_path = NULL,
iso3c = NULL,
year = NULL,
res = "5min",
adm_level = 1,
solve_level = 0,
model = "max_score",
gams_path = NULL
)
character string with the main SPAM folder. Note that R uses forward slash or double backslash to separate folder names.
character string with the raw data folder. This makes it
possible to store the raw data on a server. If raw_path
is not specified
it is automatically set to the default raw data folder in the main model
folder.
character string with the three letter ISO 3166-1 alpha-3 country code, also referred to as iso3c. A list of country codes can be found in Wikipedia.
numeric with the reference year for SPAM.
character with the resolution of SPAM. Accepted inputs are "5min" (default) and "30sec".
integer with the level up to which subnational statistics are available. Accepted inputs are 0 (only national level data), 1 (national level and first level administrative unit - default) and 2 (national level, first and second level administrative unit).
integer that indicates the level at which the model is solved. Accepted inputs are 0 (model is run at national level - default) and 1 (model is solved for each first level administrative unit separately). level and first level administrative unit - default)
character that specifies the type of model that is run. Accepted inputs are "max_score" and "min_entropy". See package documentation for more information.
spam_par object
spam_par
creates an object of class spam_par
, which bundles all required
spam parameters set by the user: SPAM folder, raw data folder, country alpha-3
code and name, year, spatial resolution, most detailed level at which
subnational statistics are available, administrative unit level at which the
model is solved, type of model, three digit country code, FAO country code and
continent. The coordinate reference system is automatically set to WGS84
(epsg:4326).
If GAMS is properly installed, the GAMS executable is automatically found, which is required to load the libraries to create gdx files. In case this gives problems the location of GAMS can be added manually.
countrycode
is used to determine the full country
name, three digit country code, three digit FAO country code and continent on
the basis of the alpha-3 country code. This information is required to extract
country specific information from several datasets.
if (FALSE) {
spam_par(spam_path = "C:/Users/dijk158/Dropbox/mapspam2globiom_mwi",
iso3c = "MWI", year = 2010, res = "5min", adm_level = 1,
solve_level = 0, model = "max_score", gams_path = "C:/GAMS")
}