t90p_std {rIACI} | R Documentation |
Calculate Standardized T90p Index
Description
Calculates the standardized T90p index.
Usage
t90p_std(ci, freq = c("monthly", "seasonal"))
Arguments
ci |
List. Climate input object. |
freq |
Character. Frequency of calculation, either "monthly" or "seasonal". |
Value
Data frame with dates and standardized T90p values.
Examples
# 1. Generate a daily date sequence from 1960-01-01 to 2020-12-31
dates <- seq.Date(
from = as.Date("1960-01-01"),
to = as.Date("2020-12-31"),
by = "day"
)
# 2. Create random weather data for each date
n <- length(dates)
tmax <- runif(n, min = 5, max = 40)
tmin <- runif(n, min = -10, max = 5)
# Example: use a Poisson distribution to simulate precipitation
prec <- rpois(n, lambda = 2)
# Random wind speeds, e.g., 0 to 10 m/s
wind <- runif(n, min = 0, max = 10)
# 3. Construct the climate_input object
ci <- climate_input(
tmax = tmax,
tmin = tmin,
prec = prec,
wind = wind,
dates = dates
)
# Then:
# 4. Calculate standardized T90p index on a monthly basis
t90p_std_values <- t90p_std(ci, freq = "monthly")
[Package rIACI version 1.0.0 Index]