tradeoff_mod: Spatial tradeoffs model

Description Usage Arguments Details Value Note Examples

Description

Master module that calls four major modules and associated helper functions, to create a single land use tradeoff scenario.

Usage

1
2
tradeoff_mod(prod_targ, cbetas, currprodmod = 1, exist_list = NULL,
  it = 1, input_key = "ZA", ybetas, ybeta_update = 0, silent = TRUE)

Arguments

prod_targ

Production targets passed as list. See examples for format.

cbetas

Vector of constraints to apply to land use. See examples.

currprodmod

Modifiers of current yield/production (default 1)

exist_list

NULL, otherwise list of inputs (from input_handler)

it

Iteration number, default 1, used to suffix for run_code

input_key

Country/location code indicating input data to load.

ybetas

list of 2 rasters or 2 vectors providing yield modifications

ybeta_update

1 or 0 (default) - determines whether yield_mod_* is run.

silent

Silent or verbose mode (TRUE [default] or FALSE)

Details

Much of the detail of running the model, and examples that help to illustrate it, are in the examples for the individual model components, including checks for consistency between "D" and "R" versions.

Value

Data.frame of impacts, and data.table referencing conversions.

Note

The impacts module has to be fixed still to not double-count impacts resulting from multi-season cropping in converted pixels. The iter parameter is used to keep the grid outputs from batch run in sequence.

Examples

1
2
3
4
5
6
7
8
9
prod_targ <- c("maize" = 4, "soy" = 2)

# cbeta vector
cbetas <- c(0.5, 0.5, 0, 0)
names(cbetas) <- c("Y", "C", "BD", "COST")

tdt <- tradeoff_mod("ZA", prod_targ, ybetas, cbetas)  
CRSobj <- projection(raster("external/ext_data/ZA-carbon-priorities.tif"))
plot(dt_to_raster(tdt$conv, CRSobj = CRSobj) - tdr$conv)  # check maps

PrincetonUniversity/agroEcoTradeoff documentation built on May 8, 2019, 3:12 p.m.