To support the preparation of the subnational statistics, create_raw_statistics_template() can create three types of data templates:

  • ha for harvest area statistics

  • fs for farming system share

  • ci for cropping intensity.

create_statistics_template(type, param)

Arguments

type

Character vector that refers to the type of template that needs to be created. See details for allowed input.

param

Object of type spam_par that bundles all SPAM parameters, including core model folders, alpha-3 country code, year, spatial resolution, most detailed level at which subnational statistics are available, administrative unit level at which the model is solved and type of model.

Details

The function requires information on how the different administrative unit levels are nested. This file needs to be created first by running create_adm_list().

The dimensions of the ha template are determined by adm level set by spam_par(), while the dimensions of the fs and cs templates (which are identical) are determined by the solve level parameter.

Examples

create_statistics_template(type = "ha", param)
#> Error in stopifnot(inherits(param, "spam_par")): object 'param' not found