precipitation_above_reference: Get proportion of rainfall above reference

View source: R/rainfall.R

precipitation_above_referenceR Documentation

Get proportion of rainfall above reference

Description

Calculates the proportion of rainfall above the refrerence_rainfall value. Usually the reference corresponds to the 95th percentile of a climate normal/reference period. The proportion is often calculated in an annual basis and is a measure of the proportion of annual total rain that falls in intense events. This measure provides information about the importance of intense rainfall events for total annual rainfall.

Usage

precipitation_above_reference(precipitation, reference_precipitation,
  wet_day_threshold = 1)

Arguments

precipitation

vector with rainfall values

reference_precipitation

reference value of precipitation

wet_day_threshold

Numeric. Amount of precipitation at which the day is considered a wet day. Defaults to 1.

Value

a value between 0 and 1

See Also

Other rainfall functions: get_reference_precipitation

Examples

library(dplyr)
# Simulate one measurement of rain per day for 10 years
rainfall <- rlnorm(10*365)
years <- rep(2001:2010, each = 365)
rain_data <- tibble(rainfall = rainfall, year = years)
# We chose a climate normal
climate_normal <- c(2001, 2005)

rain_data %>%
# calculate reference rainfall
  mutate(ref = get_reference_precipitation(rainfall,
                                            year,
                                            climate_normal,
                                            percentile = 95L)) %>%
# calculate prorportion of rainfall above reference
  group_by(year) %>%
  summarise(prop_above = precipitation_above_reference(rainfall, ref))

StatisticsNZ/er.helpers documentation built on Oct. 2, 2023, 7:24 a.m.