Last data update: 2014.03.03

R: Plot a hydrograph
hydrographR Documentation

Plot a hydrograph

Description

Creates a hydrograph with one or two streamflow data sets, and can include a precipitation hyetograph.

Usage

hydrograph(input = matrix(ncol = 2, nrow = 2), streamflow = input[, 2],
 timeSeries = input[, 1], streamflow2 = NULL, precip = NULL, begin = 1,
 endindex = length(streamflow), P.units = "", S.units = "",
 S1.col = "black", S2.col = "red", stream.label = "Streamflow",
 streamflow3 = NULL, streamflow4 = NULL, precip2 = NULL)

Arguments

input

This is a data frame with at least two columns of data First column: Must be a time/date series Second column: If including precip, precip. Otherwise, streamflow - AND do not include any other columns Third column: (Only include if precip is in the second column) First streamflow dataset Forth column: (optional) Second streamflow dataset

streamflow

vector of streamflow values - not necessary if using "input"

timeSeries

vector of time or date values - not necessary if using "input"

streamflow2

optional vector of streamflow values - not necessary if using "input"

precip

vector of precipitation values - not necessary if using "input"

begin

If you don't want to graph the whole data set, include the index where you would like to start

endindex

If you don't want to graph the whole dataset, include the index where you would like to end

P.units

Precipitation units (character)

S.units

Streamflow units (character). Users who have volumetric flow will have the superscript correctly formatted if they enter "m3s" or "ft3s"

S1.col

color of the line representing streamflow

S2.col

color of the line representing second streamflow data

stream.label

character string - Label for vertical axis

streamflow3

optional vector of additional streamflow values

streamflow4

optional vector of additional streamflow values

precip2

optional vector of a second precip gage data if you are interested in comparing precip inputs

Warning

The date series should be continuous and evenly spaced. If not, the dates will not line up accurately on the x-axis.

Note

This function can now take NA values. If you chose to use the input argument but are not including precipitation, input must only have two columns - you will need to add the second streamflow dataset using the "streamflow2" argument.

Author(s)

Josephine Archibald

Examples

data(OwascoInlet)
head(OwascoInlet)
hydrograph(OwascoInlet)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(EcoHydRology)
Loading required package: operators

Attaching package: 'operators'

The following objects are masked from 'package:base':

    options, strrep

Loading required package: topmodel
Loading required package: DEoptim

DEoptim package
Differential Evolution algorithm in R
Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich

Loading required package: XML
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EcoHydRology/hydrograph.Rd_%03d_medium.png", width=480, height=480)
> ### Name: hydrograph
> ### Title: Plot a hydrograph
> ### Aliases: hydrograph
> 
> ### ** Examples
> 
> data(OwascoInlet)
> head(OwascoInlet)
        date  P_mm Streamflow_m3s baseflow_m3s Tmax_C Tmin_C
1 2009-04-22 4.318           3.77    0.0000000  17.78   3.89
2 2009-04-23 3.302           4.08    0.2943750  10.56   1.67
3 2009-04-24 0.254           3.65    0.5621719  10.00  -2.22
4 2009-04-25 0.000           3.23    0.7780090  24.44  -1.11
5 2009-04-26 0.000           2.97    0.9521583  30.56  11.11
6 2009-04-27 0.000           2.80    1.0971214  28.33  10.00
> hydrograph(OwascoInlet)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>