# Daily precipitation data
daily_prcp <- data.frame(
date = seq(as.Date("2000-01-01"), as.Date("2002-12-31"), by = "day"),
rainfall = pmax(0, rgamma(1096, shape = 0.5, scale = 10))
)
# Calculate Simple Daily Intensity Index
calculate_SDII(
df = daily_prcp,
frequency = "daily",
time_col = "date",
prcp_col = "rainfall"
)
# With custom wet threshold (5mm instead of 1mm)
calculate_SDII(
df = daily_prcp,
frequency = "daily",
time_col = "date",
prcp_col = "rainfall",
wet_threshold = 5
)
Run the code above in your browser using DataLab