Learn R Programming

Ditwah (version 1.0.0)

compute_flood_stats: Computes number of hours in alert, minor and major levels starting from 26 Nov 2025

Description

Classify flood levels as alert, minor and major and compute the total number of hours in each state

Usage

compute_flood_stats(data, DateTime, RiverWaterLevel, alert, major, minor)

Value

A list containing a tibble including new variable called state classifying flood level and total number of hours spent in each state

Arguments

data

data frame with variables date and time, river water level, alert level, major flood level and minor flood level

DateTime

Variable name corresponds to Date and Time (%Y-%m-%d %H:%M)

RiverWaterLevel

Variable name corresponds to the River Water Level

alert

Alert level numeric value

major

Major flood level numeric value

minor

Minor flood level numeric value