cumulative_table: Accumulate Data Over Time and/or Space

Description Usage Arguments Value Examples

View source: R/main.r

Description

Accumulate data from a table over time and/or longitudinally.

Usage

1
2
cumulative_table(d, time.col = "Time", over.time = TRUE,
  longitudinal = TRUE, direction = c("upstream", "downstream"))

Arguments

d

A wide-format table containing values to accumulate.

time.col

The time column name.

over.time

If TRUE, accumulate data across time steps. This is generally valid only for data output at the computation time step.

longitudinal

If TRUE, accumulate data along the reach. This is generally only valid when all cross sections are included in d.

direction

Accumulate data in the downstream (descending order of cross section IDs) or upstream (ascending order) direction. Ignored if longitudinal is FALSE.

Value

A data frame containing the accumulated data from d. Note that d may be reordered in time and by cross-section.

Examples

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

cumulative_table(quasi.flow, over.time = TRUE, longitudinal = FALSE)
cumulative_table(quasi.flow, over.time = TRUE, longitudinal = TRUE)
cumulative_table(quasi.flow, over.time = TRUE, longitudinal = TRUE,
  direction = "downstream")

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