
Data specification for importing
data_specification.RdA list containing data structures, expected column types, and requirement levels
(mandatory or optional) for each table / sheet used in floodam.cba input files
(ODS or Excel format), including uncertainty and sensitivity analysis specifications.
Format
A named list with 10 elements:
action: Specifications for action costs and scheduling (steps, durations, study, land, construction, environment, maintenance, and other recurring costs).
complement: Specifications for complementary / intangible flood impacts (sector, stake, state, scenario, unit, flood).
damage: Specifications for direct flood damage data (sector, stake, state, scenario, unit, flood).
evolution: Specifications for temporal or baseline trends of impacts (sector, stake, state, unit, flood).
event: Specifications for flood events and state changes (base, change).
flood: Specifications for flood return periods or probabilities (sector, flood).
project: Specifications for project definitions, action schedules, and state transitions (project, action, action_start, state_ori, state_fin, constraint).
scenario: Specifications for failure and protection scenarios (sector, state, scenario, flood).
uncertainty: Specifications for sensitivity and uncertainty analysis input parameters (parameter, min, max, type).
no_na: Default values used to replace missing (
NA) values for specific fields (e.g.,step_duration = +Inf).
Details
data_specification defines the schema for importing case study data via
import_case() and internal helper functions (any_specification(),
find_specification(), find_type(), find_no_na(), and find_no_na_value()).
For each table specification (except no_na), each expected column is described by:
type: The expected R data type (character,integer,double, orfactor).status: Whether the column ismandatoryoroptional.
Uncertainty sheet
The uncertainty element specifies the structure required for sensitivity and
uncertainty analyses on CBA indicators. The expected columns are:
parameter: (character, mandatory) Name of the parameter subject to uncertainty.min: (double, mandatory) Lower bound of the parameter range.max: (double, mandatory) Upper bound of the parameter range.type: (factor, mandatory) Distribution or variation type (e.g., uniform, normal).
Author
Frédéric Grelot, frederic.grelot.1994_cran@m4x.org
Examples
# Available table specifications
names(data_specification)
#> [1] "action" "complement" "damage" "evolution" "event"
#> [6] "flood" "project" "scenario" "uncertainty" "no_na"
# Structure and requirements of the uncertainty sheet
data_specification$uncertainty
#> $parameter
#> $parameter$type
#> [1] "character"
#>
#> $parameter$status
#> [1] "mandatory"
#>
#>
#> $min
#> $min$type
#> [1] "double"
#>
#> $min$status
#> [1] "mandatory"
#>
#>
#> $max
#> $max$type
#> [1] "double"
#>
#> $max$status
#> [1] "mandatory"
#>
#>
#> $type
#> $type$type
#> [1] "factor"
#>
#> $type$status
#> [1] "mandatory"
#>
#>
# Inspect data types and status for the 'project' sheet
sapply(data_specification$project, `[[`, "type")
#> project action action_start state_ori state_fin constraint
#> "character" "character" "integer" "character" "character" "character"
sapply(data_specification$project, `[[`, "status")
#> project action action_start state_ori state_fin constraint
#> "mandatory" "mandatory" "mandatory" "mandatory" "mandatory" "optional"
# Inspect default replacement values for NA
data_specification$no_na
#> $action
#> $action$step_duration
#> [1] Inf
#>
#>