Description Usage Arguments See Also Examples
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 rasters.
1 | targets_r(prod_targ, currprod, potprod, cropnames)
|
prod_targ |
A named list given the production targets for each crop as a multiple (greater than 1) |
currprod |
A RasterBrick of the current production coming from existing croplands |
potprod |
A RasterBrick of the potential production on existing croplands |
filename |
Output filename. Default is "default", in which case a system generated name is created |
targets_dt
for data.table version
1 2 3 4 5 6 7 8 9 | rc <- run_code(input_key = "ZA") # creates a once off code for any outputs saved from this simulation
ilr <- fetch_inputs(input_key = "ZA", input = "R") # fetch all necessary inputs
ybetas <- c(1, 1)
ybetar <- yield_mod_r(inlist = ilr[c("p_yield", "pp_curr")], ybetas = ybetas, code = rc,
cropnames = ilr$cropnames)
prod_targr <- c("maize" = 2, "cassava" = 2, "ground" = 2, "cotton" = 2, "soy" = 2, "pulse" = 2,
"sunflower" = 2, "sugarcane" = 2, "wheat" = 2)
targetr <- targets_r(prod_targ, currprod = ilr$currprod, potprod = ybetar$pp_curr, code = rc,
cropnames = ilr$cropnames)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.