discharge | R Documentation |
Get and set discharge and cross-sectional area of a river network
## S3 method for class 'river_network'
discharge(x, type = c("raw", "current", "history"))
## S3 replacement method for class 'river_network'
discharge(x) <- value
## S3 method for class 'river_network'
area(x, type = c("raw", "current", "history"))
## S3 replacement method for class 'river_network'
area(x) <- value
x |
A |
type |
The type of record to get; either the raw data, the current state, or the whole history |
value |
Discharge/cross-sectional area (see 'details') |
There are three possible models for discharge/cross-sectional area, depending on the kind of input provided.
If discharge is provided as a vector or a single-column matrix, then discharge will be treated as constant throughout any simulations. In this case, then length of the input must equal the number of nodes in the river network.
If discharge is provided as a matrix with ncol > 1, then a variable discharge model will be used. The input in this case is a hydrograph, where the rows are nodes in the river network and the columns are time steps. Time steps will be recycled, so if a model is run for a more steps than is present in the discharge matrix, then discharge will restart at the first columns of the matrix.
The final possibility is to provide a function that takes a single parameter, the time step, as input and returns a discharge vector with one element per node in the river network.
Cross sectional area can either be missing or provided in the same format as discharge. If
missing, then cross sectional area will be computed using hydrological scaling relationships;
see geometry()
for details.
Note that if cross-sectional area is provided, then the discharge model is changed (e.g., from constant to variable), it is strongly recommended (and not checked!) that the user ALSO update cross-sectional area to match the new model, otherwise undefined behavior will occur.
area(x) <- NULL
will delete any provided cross sectional area and revert to the default
behavior, computing area using geometry()
A discharge vector
Cross-sectional area vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.