xs_lengths: Compute Cross Section Lengths

Description Usage Arguments Details Value Examples

View source: R/xs.r

Description

Compute cross section lengths from the river station lengths table.

Usage

1
xs_lengths(station.lengths, stations = NULL, station.col = "Station")

Arguments

station.lengths

A data frame containing station lengths, i.e. output of read_station_lengths. Must include columns "Station" and "Channel".

stations

A list of stations to compute lengths for.

station.col

The column in station.lengths containing the cross section stations.

Details

The cross section length is computed as the average of the current river station channel length and the upstream river station channel length; in other words, the cross section control volume is assumed to extend half the channel distance between the next upstream and downstream cross sections.

Value

a dataframe with columns "Station" and "Length", where column "Length" lists the cross section length.

Examples

1
2
3
4
5
6
7
8
9
simple.quasi = system.file("sample-data/SampleQuasiUnsteady.hdf",
  package = "RAStestR")

quasi.lengths = read_station_lengths(simple.quasi)
xs_lengths(quasi.lengths)
xs_lengths(quasi.lengths, head(quasi.lengths$Station))
xs_lengths(quasi.lengths, tail(quasi.lengths$Station))
xs_lengths(quasi.lengths, 
  quasi.lengths$Station[seq(1, nrow(quasi.lengths), 2)])

mkoohafkan/RAStestR documentation built on July 14, 2019, 11:41 p.m.