Skip to contents

Compute nominal avoided damages by flood event and by stake for a given project, merged with stake uncertainty bounds.

Usage

prepare_sa_impact(case, project)

Arguments

case

An object of class Case.

project

Character scalar, name of the project to analyze.

Value

A data.frame containing column stake, nominal avoided damages for each flood event (named flood_<event>), and uncertainty columns min, max, and type.

Details

The function evaluates nominal avoided damages between the initial and final project states across all flood events and stakes using format_impact() at the "global" sector level.

Flood event columns are prefixed with "flood_". The resulting nominal avoided damages are merged with the stake direct damage uncertainty bounds (min, max, type) from case["uncertainty"] (with the stake_ prefix removed).

Author

Frédéric Grelot, frederic.grelot.1994_cran@m4x.org

Examples

case = import_case(
    system.file("extdata", "case", "complete.ods", package = "floodam.cba")
)
#> import Case from /tmp/RtmpvMoJJK/temp_libpath2b69f6f14b9e9/floodam.cba/extdata/case/complete.ods
#>  ... done
project = setdiff(unique(case["project"][["project"]]), "baseline")[1]
prepare_sa_impact(case, project)
#>         stake flood_min flood_med flood_max  min max     type
#> 1    activity         0     199.8      3996 -0.5 0.5 relative
#> 2 agriculture         0     -99.9     -1998 -0.5 0.5 relative
#> 3    dwelling         0     199.8      3996 -0.5 0.5 relative