precipitation_above_reference | R Documentation |
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.
precipitation_above_reference(precipitation, reference_precipitation,
wet_day_threshold = 1)
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. |
a value between 0 and 1
Other rainfall functions: get_reference_precipitation
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.