Skip to contents

`combine_damaging()` combines damage curves for specified crops or all crops and for each type of damage and saves the results.

Usage

combine_damaging(
  path,
  damage.culture = NULL,
  hazard = NULL,
  weight = NULL,
  verbose = TRUE,
  retrieve = NULL
)

Arguments

path

list describing where to find useful paths.

damage.culture

list of data.frames of disaggregated damage for each crop to be combined. Result of `calculate.damaging()` can be used, default to NULL.

hazard

data.frame of hazard parameters. Should have the same number of rows as the damage functions in `damage.culture`. If NULL, it will be loaded from `file.path(path[["output"]][["damage"]], "hazard.csv")`. Default to NULL.

weight

character indicating the base name weight method. If NULL, no weights are used and damage functions are `cbind()` in one data.frame for each damage (`c("total", "yield.annual", "yield.differed","replanting", "soil", material")`). Default to NULL.

verbose

logical, should the function send some messages while running.

retrieve

character, which damage type should be returned. If NULL, nothing is returned. Default to NULL.

Value

`combine_damaging()` returns one data.frame for each damage type `c( "total", "yield.annual", "yield.differed","replanting", "soil", material")` which contains damage curves for each crop in `names(damage.culture)`.