pentadProbs | R Documentation |
This function calculates the probability od occurrence of a temperature range in a five-day row (pentad).
pentadProbs( mx, mn, temp_dates, out = NULL, min_abs = -20, max_abs = 44, plot_years = NULL, show_legend = TRUE )
mx |
vector containing the daily maximum temperature series. |
mn |
same as mx but with daily minimum temperature series. |
temp_dates |
sequence of daily dates coinciding with temperature data series. |
out |
system path to the generated output file ('.pdf'). |
min_abs |
minimum absolute temperature used as threshold to plot data. |
max_abs |
same as min_abs but with maximum absolute temperature. |
plot_years |
numeric vector indicating the frequencies of individual years to plot over the averages. |
show_legend |
logical value indicating wether legend will be shown or not. |
The numer of individual years to plot over the average frequencies is unlimited. However, it is recommended to add only a few due to the difficult of reading a lot of information in the same plot.
The colors of the individual years are random, so it is possible to get different colors for same years in two runs of same plot.
If the output path is defined, a pdf file is created.
# basic plot with legend pentadProbs(mx = daily_tmax, mn = daily_tmin, temp_dates = seq.Date(as.Date('1981-01-01'), as.Date('2010-12-31'), by ='day'), out = NULL, min_abs = -20, max_abs = 44, plot_years = NULL, show_legend = TRUE) # years 1981 and 2009 are plotted over the average frequencies pentadProbs(mx = daily_tmax, mn = daily_tmin, temp_dates = seq.Date(as.Date('1981-01-01'), as.Date('2010-12-31'), by ='day'), out = NULL, min_abs = -20, max_abs = 44, plot_years = c(1981, 2009), show_legend = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.