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

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

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.

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)`.