plotPairs | R Documentation |
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 vector |
data.2 |
The second data vector |
events |
The pairedeEvents data frame from pairEvents |
dates |
Optional date vector |
type |
The type of plot (see details) |
color.list |
Vector of colours used for plotting |
xlab |
x-axis label |
ylab.1 |
primary y-axis label |
ylab.2 |
secondary y-axis label |
cex.2 |
cex for secondary y-axis label |
main |
Plot title |
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.
No return value.
pairEvents
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.