Plot Paired Events
Wrapper function for plotting paired events.
plotPairs( data.1, data.2, events, dates = NULL, type = "hyet", color.list = rainbow(nrow(events)), xlab = "", ylab.1 = "", ylab.2 = "", cex.2 = 1, main = "" )
data.1
: The first data vectordata.2
: The second data vectorevents
: The paired events data frame from pairEventsdates
: Optional date vectortype
: The type of plot (see details)color.list
: Vector of colours used for plottingxlab
: x-axis labelylab.1
: primary y-axis labelylab.2
: secondary y-axis labelcex.2
: cex for secondary y-axis labelmain
: Plot titleNo return value.
If the type is "hyet"
then data.1
is plotted as a vertical lines and data.2
as a line. If the type is "lineover"
then all data is plotted as lines.
library(hydroEvents) BFI_res = eventBaseflow(dataBassRiver) POT_res = eventPOT(dataLoch) pairs.1 = pairEvents(POT_res, BFI_res, type = 1, lag = 5) pairs.3 = pairEvents(POT_res, BFI_res, type = 3, lag = 3) d = as.Date("1974-06-30") + 0:(length(dataBassRiver)-1) oldpar <- par(mar = c(3, 3.5, 2, 3.5), mfrow = c(2, 1)) plotPairs(dataLoch, dataBassRiver, pairs.1, dates = d, type = "hyet", xlab = "Date", ylab.1 = "Rain (mm)", ylab.2 = "Flow (ML/day)", main = "Matching Forward") plotPairs(dataLoch, dataBassRiver, pairs.3, dates = d, type = "hyet", xlab = "Date", ylab.1 = "Flow (ML/day)", ylab.2 = "Rain (mm)", main = "Matching Backward") par(oldpar)
pairEvents