Skip to contents

Internal function called by the main mrdrivers calc functions, that maps over any vectorised arguments. Should only be of interest to package developers.

Usage

calcDriver(
  driver,
  scenario,
  popAsWeight = FALSE,
  naming = "indicator_scenario",
  extension2150 = "bezier"
)

Arguments

driver

A string designating the driver. Available drivers are:

  • GDP

  • Population

  • GDPpc

  • Labour

  • Urban

scenario

A string (or vector of strings) designating the scenario(s) to be returned. Use toolGetScenarioDefinition() to learn what scenarios are available.

popAsWeight

If TRUE, then population data of the same scenario is used as weight.

naming

A string giving the naming scheme of the data dimension. Can be either:

  • "indicator_scenario" (default): Returns names of the type "gdp_SSP2", or "pop_SSP2".

  • "indicator.scenario": (deprecated) Returns names of the type "gdp.SSP2", or "pop.SSP2".

  • "scenario": Returns names of the type "SSP2".

Set naming to "scenario" when you want to operate on SSP2 gdp and population data for instance, and not have to worry about the conflicting names.

extension2150

A string specifying if/how the scenarios should be extended until 2150. Can be either:

  • "bezier" (default): A bezier curve extension that leads to a smooth flattening of the scenario: the slope in the last year of the scenario is halved by 2150. Currently only works for scenarios with 2100 as their last year.

  • "constant": The last value of the scenarios is taken as constant until 2150.

  • "none": No extension.

Value

magpie object with the requested output data either on country or on regional level depending on the choice of argument "aggregate" or a list of information if supplementary is set to TRUE.

Vectorization of arguments

Vectors are accepted for most arguments. If given a vector, different combinations are created and returned all at once. If more than one argument is vectorised, the arguments have to have the same length. Which time series are created can be illustrated with the following example. Let's say the "harmonization" and "pastdata" arguments are vectors of length 3. Then there will be in total 3 time series that are produced: the first time series is the result of combining the first harmonization element with the first pastdata element, the second time series the result of combining the second harmonization element with the second pastdata element, and the third time series the result of using the respective third entry. The futuredata element used in each case is the same, since in this example only one futuredata element is provided.

See also

calcGDPPast() for the scenario builiding blocks.