Skip to contents

Adjust consecutive return period uncertainty ranges to prevent any overlap by setting consecutive limits to their midpoint, and return the data frame with absolute values.

Usage

prepare_flood_range(nominal, uncertainty)

Arguments

nominal

Named numeric vector of nominal return periods, where names match flood event identifiers (e.g. "T10", "T100").

uncertainty

A data.frame with columns parameter, min, max, and type. The parameter column contains entries formatted as period_<flood>.

Value

Updated data.frame with absolute min and max bounds without overlap, preserving the original row order of uncertainty.

Details

The function converts any relative bounds (type == "relative") into absolute values based on nominal (nominal * (1 + bound)). It sorts return periods in ascending order and verifies consecutive ranges.

If consecutive ranges overlap (the upper bound max of an event exceeds the lower bound min of the immediately higher event), these consecutive bounds are adjusted to their midpoint: mid = (max_i + min_{i+1}) / 2 (using pmin on max and pmax on min).

The returned data.frame always has type = "absolute". The original row order of the input uncertainty table is strictly preserved in the output.

Author

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