interarrival {seas} | R Documentation |
Calculate the interarrivals between and within precipitation events
Description
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).
Usage
interarrival(x, var = "precip", p.cut = 0.3, inv = FALSE)
Arguments
x |
a |
var |
a variable on to which the interarrivals are calculated;
default is |
p.cut |
days with precipitation values greater than |
inv |
|
Details
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.
Value
interarrival
object (which inherits the data.frame
class) with date
, wet
, dry
columns.
The table has id
and name
attributes (if
available from x
).
Author(s)
Mike Toews
References
von Storch, H. and Zwiers, F.W., 1999. Statistical analysis in climate research, Cambridge: Cambridge University Press, 484 p.
See Also
Examples
data(mscdata)
van.int <- interarrival(mksub(mscdata, id=1108447))
summary(van.int)
van.int[which.max(van.int$dry),]
van.int[which.max(van.int$wet),]
plot(van.int, ylog=FALSE, maxy=30)