View source: R/river_network.R
river_network | R Documentation |
Create a river network
river_network(
adjacency,
discharge,
area,
length = 1,
layout,
site_names = rownames(adjacency),
skip_checks = FALSE
)
adjacency |
An adjacency matrix; see 'details' |
discharge |
Optional discharge values, see |
area |
Optional cross sectional area values, see |
length |
The length of each reach, must be a single value (the model assumes all reaches are the same length) |
layout |
Optional, matrix of x-y coordinates used for plotting the network |
site_names |
Optional vector of site names |
skip_checks |
Logical; if true, no checks for valid topology will be performed |
The adjacency matrix must be a square matrix, with a row/column for each river network reach. Zero entries indicate no adjacency between reaches. Nonzero entries indicate adjacency, with the row indicating the upstream reach and the column the downstream (i.e., adjacencyi,j == 1 indicates water flows from i to j). Nonzero elements will be set equal to one.
An S3 object of class 'river_network', with the following members:
adjacency
The adjacency matrix
discharge
A discharge vector
area
Cross sectional area at each node
.state
The state history of the network; access with state.
Additionally, the layout
attribute, if used, is a matrix of coordinates for plotting
Q = rep(1, 4)
adj = matrix(0, nrow = 4, ncol = 4)
adj[1,2] = adj[2,3] = adj[4,3] = 1
rn = river_network(adj, Q)
plot(rn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.