targets_dt: Calculates crop production targets

Description Usage Arguments Details See Also Examples

View source: R/targets.R

Description

This module calculates the amount of production (in tonnes) for each modelled crop, given user-specified targets, how much of it can be met on existing cropland, and how much needs to come from new cropland. This version works with dta.tables.

Usage

1
targets_dt(prod_targ, currprod, potprod)

Arguments

prod_targ

A named list given the production targets for each crop as a multiple (greater than 1)

currprod

A data.table of the current production coming from existing croplands

potprod

A data.table of the potential production on existing croplands

Details

If there is a modification to yield potentials due to climate change or irrigation, potprod (which is again only the potential production on existing croplands) should be extracted from the results of the yield_mod_dt function.

See Also

targets_r for raster-based version

Examples

1
2
3
4
5
6
7
8
9
il <- fetch_inputs(input_key = "ZA")  # fetch all necessary inputs
ybetas <- list(1, 1)
ybeta <- yield_mod_dt(inlist = il[c("p_yield", "pp_curr")], ybetas = ybetas,
                      code = rc, cropnames = il$cropnames)
potprod <- ybeta$pp_curr
currprod <- il$currprod
prod_targ <- c("maize" = 2, "cassava" = 2, "ground" = 2, "cotton" = 2, "soy" = 2, "pulse" = 2,
               "sunflower" = 2, "sugarcane" = 2, "wheat" = 2)
t_dt <- targets_dt(prod_targ, currprod, potprod)

marcusspiegel/agroEcoTradeoff documentation built on May 21, 2019, 11:44 a.m.