Learn R Programming

FlowScreen (version 2.0)

screen.frames: Plot one or more frames from the summary screening plot

Description

This function plots one or more frames (i.e. time series plot) from any of the three plot.screening summary plots at a time. It can be used to create custom summary plots - see the example code.

Usage

screen.frames(
  metrics,
  type = "h",
  element = NULL,
  language = "English",
  mmar = c(3, 4, 0.5, 0.5),
  title = FALSE,
  multi = F,
  xaxis = T
)

Arguments

metrics

output from metrics.all

type

Character string indicating the set of metrics to plot. Options are "h" for high flow metrics, "l" for low flow metrics, or "b" for baseflow metrics.

element

Numeric index(es) (1-10) of the frame(s) to plot, see details of this function for the list of metrics for each category (high, low, baseflow). Each category has ten different metrics that can be plotted individually. Default is NULL, which creates individual plots for all ten metrics. A list of elements c(1, 5, 10) can be specified or a range c(1:5).

language

Language for plot labels. Choice of either "English" or "French". Default is "English".

mmar

Numeric vector specifying plot margins. Default is c(3,4,0.5,0.5)

title

optional plot title. Default is FALSE indicating no plot title is wanted. Set to TRUE to use the the default plot title, which will look for 'plot title' attribute of the data.frame set by set.plot.titles. All values other values will be used as a custom plot title. Set to FALSE to use this function in a multi-plot layout.

multi

Boolean indicating whether the function is being used to create one plot in a multi-plot layout. Default is F. If T, suppresses the reset of plot parameter settings. This plot function will only work for a multi-plot layout if text=F

xaxis

Boolean indicating whether to plot an x-axis. Default = T.

Author

Jennifer Dierauer and Paul Whitfield

Details

High flow metrics include:

  1. Annual Maximum Series

  2. Annual Maximum Day of Year

  3. Peaks Over Threshold (Qmax)

  4. Inter-Event Duration

  5. Q80

  6. Q90

  7. Day of Year 25 percent Annual Flow

  8. Center of Volume

  9. Day of Year 75 percent Annual Flow

  10. Duration between 25 percent and 75 percent Annual Flow

Low flow metrics include:

  1. Q10

  2. Q25

  3. Drought Start

  4. Drought Center

  5. Drought End

  6. Drought Duration

  7. Drought Severity

  8. Annual Minimum Flow

  9. Mean Annual Minimum 7-day Flow

  10. Mean Annual Minimum 10-day Flow

Baseflow metrics include:

  1. Mean Daily Discharge

  2. Annual Baseflow Volume

  3. Annual Mean Baseflow

  4. Annual Maximum Baseflow

  5. Annual Minimum Baseflow

  6. Mean Annual Baseflow Index

  7. Day of Year 25 percent Baseflow Volume

  8. Center of Volume Baseflow

  9. Day of Year 75 percent Baseflow Volume

  10. Duration between 25 percent and 75 percent Baseflow Volume

Examples

Run this code
# load results from metrics.all function for the Caniapiscau River
data(caniapiscau.res)
caniapiscau.ts <- caniapiscau.res$indata

# plot one frame from the baseflow screening plot
screen.frames(caniapiscau.res, type="b", element=1)

# plot three frames from the low flow screening plot
screen.frames(caniapiscau.res, type="l", element=c(1:3))

# create a custom summary plot
opar <- par(no.readonly = TRUE)
layout(matrix(c(1,2,3,4), 2, 2, byrow=TRUE))
par(oma=c(0,0,3,0))
stninfo <- station.info(caniapiscau.ts$Agency[1], caniapiscau.ts$ID[1], Plot=TRUE)
screen.frames(caniapiscau.res, type="h", element=1, multi=TRUE)
screen.frames(caniapiscau.res, type="l", element=1, multi=TRUE)
screen.frames(caniapiscau.res, type="b", element=1, multi=TRUE)

par <- opar
layout(1,1,1)

# or plot everything!
opar <- par(no.readonly = TRUE)
layout(matrix(c(1:30), 5, 6, byrow=TRUE))
screen.frames(caniapiscau.res, type="h", multi=TRUE)
screen.frames(caniapiscau.res, type="l", multi=TRUE)
screen.frames(caniapiscau.res, type="b", multi=TRUE)
par <- opar
layout(1,1,1)

Run the code above in your browser using DataLab