Description Usage Arguments Details Value References Examples
This functions identifies the winter events related to temperature and precipitation described in Lundqvist et al. (2007). The functions uses daily temperature (min, max, or average, in degrees Celcius) and precipitation (in mm) to identify events that may be harsh weather conditions for reindeer husbandry.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | identify_winter_event3(
date,
temp_min,
temp_max,
precipitation,
temp_min_thr = -2,
temp_max_thr = 2,
prec_thr = 3
)
identify_winter_event4(
date,
temp_avg,
precipitation,
temp_avg_day = +1,
temp_avg_next_day = -1,
prec_thr = 3
)
identify_winter_eventX(
date,
temp_min = c(),
temp_max = c(),
temp_avg = c(),
precipitation = c(),
temp_avg_day = +1,
temp_avg_next_day = -1,
temp_max_thr_day = +1,
temp_min_thr_next_day = -2,
number_days_after = 3,
prec_thr = 3
)
|
date |
date object. vector. Vector of dates in a time series of a given winter. |
temp_min |
numeric. vector. Minimum daily temperature, in Celsius. |
temp_max |
numeric. vector. Minimum daily temperature, in Celsius. |
precipitation |
numeric. vector. Precipitation accumulated each day, in mm. |
temp_min_thr |
numeric. Threshold of minimum temperature, in Celsius, used for event 3. |
temp_max_thr |
numeric. Threshold of maximum temperature, in Celsius, used for event 3. |
prec_thr |
numeric. Threshold of precipitation, in mm, used for events 3 and 4. |
temp_avg |
numeric. vector. Average daily temperature, in Celsius. |
temp_avg_day |
numeric. Threshold of average temperature in the day, in Celsius, used for event 4. |
temp_avg_next_day |
numeric. Threshold of average temperature in the following day, in Celsius, used for event 4. |
The events are:
Still to be implemented
Day when max temp > 2, min temp < -2, and precipitation > 3 mm.
Day when average temp > 1, precipitation > 3 mm, followed by day with average temp < -1.
Day when max temp > 1, precipitation > 3 mm, followed minimum temp < -2 in any of the following 3 days.
A list with the elements:
time series with 0 for days with no event and 1 with days when the event occurred.
number of days when the event occurred.
number of events, by aggregating subsequent days when it repeatedly happened.
duration of each event, in days.
starting date of each event.
time series with the counter of the number of events. Similar to events.
These elements are calculated for both the whole winter and only the first half of the winter.
Lundqvist, H., Norell, L., Danel, O. 2007. Multivariate characterisation of environmental conditions for reindeer husbandry in Sweden. Rangifer, 27(1): 5-23.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | library(ggplot2)
library(dplyr)
data(weather_mittadalen)
weather <- weather_mittadalen %>%
dplyr::filter(year == 2015)
# events 3
with(weather, identify_winter_event3(date, temp_min, temp_max, prec))
# One can also change the parameters
with(weather, identify_winter_event3(date, temp_min, temp_max, prec,
temp_max_thr = 0))
# events 4
with(weather, identify_winter_event4(date, temp_avg, prec))
# events X
with(weather, identify_winter_eventX(date, temp_max = temp_max, temp_min = temp_min,
precipitation = prec,
temp_max_thr_day = 1, temp_min_thr_next_day = -2,
number_days_after = 3))
# visualize events 4 for this year
weather_condition <-
with(weather, analyze_weather(date, snow_depth, prec, temp_min, temp_max,
temp_avg, start = "first_date",
plot_first_snow = T))
to_plot <- weather_condition
to_plot$weather_indices <- weather_condition$weather_indices %>%
dplyr::mutate(temp_avg_next = c(temp_avg[-1], NA)) %>%
dplyr::filter(lubridate::month(date) == 12)
to_plot %>%
plot_weather(term = c("temp_avg", "prec", "temp_avg_next"), factor_mult = c(1,1)) +
geom_hline(yintercept = c(-1,1), linetype = 2) +
ylim(-10, 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.