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 coordinate reference system.

spam_par(
  spam_path = NULL,
  raw_path = NULL,
  iso3c = NULL,
  year = NULL,
  res = "5min",
  adm_level = 1,
  solve_level = 0,
  model = "max_score"
)

Arguments

spam_path

character string with the main SPAM folder. Note that R uses forward slash or double backslash to separate folder names.

raw_path

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.

iso3c

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.

year

numeric with the reference year for SPAM.

res

character with the resolution of SPAM. Accepted inputs are "5min" (default) and "30sec".

adm_level

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).

solve_level

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)

model

character that specifies the type of model that is run. Accepted inputs are "max_score" and "min_entropy". See package documentation for more information.

Value

spam_par object

Details

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).

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.

Examples

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") }