Learn R Programming

hydroEvents (version 0.12.0)

plotEvents: Plot Events

Description

Wrapper function for plotting identified events.

Usage

plotEvents(
  data,
  dates = NULL,
  events,
  type = "lineover",
  colline = "red",
  colpnt = "blue",
  colbound = "red",
  ymin = min(data),
  ymax = max(data),
  xmin = NULL,
  xmax = NULL,
  xlab = "",
  ylab = "",
  main = "events"
)

Value

No return value.

Arguments

data

The data vector

dates

Optional date vector

events

Events data frame

type

The type of plot (see details)

colline

Line colour

colpnt

Point colour

colbound

Background colour for plot type "bound"

ymin

Minimum plot extent in vertical direction

ymax

Maximum plot extent in vertical direction

xmin

Minimum plot extent in horizontal direction

xmax

Maximum plot extent in horizontal direction

xlab

x-axis label

ylab

y-axis label

main

Plot title

Details

Three plot types are implemented: "lineover", "bound", "hyet". See examples. If events contains a column titled "which.max" the maxima are also plotted.

See Also

eventBaseflow eventMaxima eventMinima eventPOT

Examples

Run this code
# Plot events
library(hydroEvents)
BFI_res = eventBaseflow(dataBassRiver)

oldpar <- par(mfrow = c(3, 1), mar = c(3, 2.7, 2, 1))
d = as.Date("1974-06-30") + 0:(length(dataBassRiver)-1)
plotEvents(data = dataBassRiver, dates = d, events = BFI_res,
   type = "lineover", xlab = "Date", ylab = "Flow (ML/day)", main = "lineover")
plotEvents(data = dataBassRiver, dates = d, events = BFI_res, type = "bound",
   xlab = "Date", ylab = "Flow (ML/day)", main = "bound")
plotEvents(data = dataBassRiver, dates = d, events = BFI_res, type = "hyet",
   xlab = "Date", ylab = "Flow (ML/day)", main = "hyet")
par(oldpar)

Run the code above in your browser using DataLab