discharge: Conmputes stream discharge measurements using the...

View source: R/discharge.R

dischargeR Documentation

Conmputes stream discharge measurements using the mean-section or mid-section methods.

Description

Computes a cross-section profile of a stream demonstrating distance, velocity, and discharge measurements for the mean-section and mid-section methods.

Usage

discharge(distance, depth, velocity, type = c("Mean", "Mid"))

## S3 method for class 'discharge'
summary(object, detail = TRUE, ...)

## S3 method for class 'discharge'
plot(
  x,
  pch = 19,
  xlab = "Distance (ft)",
  ylab = "Depth (ft)",
  newwin = TRUE,
  ...
)

Arguments

distance

A vector of distance measurements at intervals across the cross section.

depth

A vector of depth measurements at intervals across the cross section.

velocity

A vector of velocity measurements at intervals across the cross section.

type

A string indicating the discharge method to use.

object

An object returned from discharge.

detail

A logical indicating whether the details of the discharge calculations should be shown (=TRUE) or not.

...

Other arguments to be passed to the plot function.

x

An object returned from discharge.

pch

The plotting character to be used for the depth profile. See par.

xlab

A string for labeling the x-axis.

ylab

A string for labeling the y-axis.

newwin

A logical indicating whether a new graphics window should be opened (only for Windows operating systems).

Value

discharge produces a list with a data frame of the original data, a data frame of computed values, the type= argument, and a label for the type of argument. plot method produce a plot demonstrating the calculations. summary returns the total discharge calculation and detailed intermediate calculations if asked for.

Examples


dist1 <- c(seq(0,22,2),24.7)
dep1 <- c(0,.9,1.1,1.1,1.1,.9,.9,.9,.9,.9,.9,.7,0)
vel1 <- c(0,1.01,1.07,1.22,1.22,1.36,1.28,1.38,1.29,0.88,0.52,0,0)
ex1 <- discharge(dist1,dep1,vel1)
summary(ex1)
plot(ex1)
ex1a <- discharge(dist1,dep1,vel1,type="Mid")
summary(ex1a)
plot(ex1a)

dist2 <- c(seq(0,18,2),19.7)
dep2 <- c(0,1.2,1.5,1.4,1.4,1.4,1.5,1.7,2,1.5,0)
vel2 <- c(0,.53,.76,.95,.90,.98,1.01,.9,.9,0,.0)
ex2 <- discharge(dist2,dep2,vel2)
summary(ex2)
plot(ex2)
ex2a <- discharge(dist2,dep2,vel2,type="Mid")
summary(ex2a)
plot(ex2a)


droglenc/FSAmisc documentation built on Jan. 8, 2023, 12:59 a.m.