interarrival {climate.plot} | R Documentation |
Calculate the interarrivals (or spell periods), which are the number of days between precipitation events (dry days), and the number of days of continuous precipitation (wet days).
# bare essentials, where dat is a data.frame interarrival(dat) # with optional arguments interarrival(dat, start, end, param = "precip", p.cut = 0.3, inv = FALSE, id)
dat |
data.frame , must have at least date and a field to calculate an interarrival with (such as precip) |
start |
start year; if omitted minimum year will be used |
end |
end year; if omitted will use same as start , and if start is omitted, will use maximum year |
param |
parameter on to which the interarrivals are calculated; default is precip |
p.cut |
days with precipitation values greater than p.cut are considered to be wet days, and the complement are dry days; a trace amount of 0.3 mm is suggested |
inv |
logical ; invert convention of the starting date such that the date is the first wet day if inv=FALSE (default), or the date is the first dry day if inv=TRUE |
id |
unique station identifier used to extract a subset of data from dat |
The interarrival is the same as the spell period (i.e., dry spell), however this function simultaneously counts the number of dry and wet days relative to a single date. The date represents the first day of precipitation (if inv=TRUE
, this convention is inverted to the first day of non-precipitation).
Missing or NA
precipitation values voids the number of counted days between and within segments, which implies that days without precipitation need to explicitly have zeros.
data.frame
object with date
, wet
, dry
and fact
fields (if supplied with a width
value).
M.W. Toews
von Storch, H. and Zwiers, F.W., 1999, Statistical analysis in climate research, Cambridge: Cambridge University Press, 484 p.
data(mscdata) van.int <- interarrival(mscdata, id=1108447) plot.interarrival(van.int, log=FALSE, maxy=30)