intact_to_sink function

Size of intact network that feeds into the sink or a particular node

Size of intact network that feeds into the sink or a particular node

The length of the subgraph network that ends (feeds into) a particular node, e.g., the sink. For a weighted graph, the sum of the weights of the subgraph are given. Thus, if weights are stream lengths the function will give the stream length of the portion of the intact stream network that feeds into a particular node.

size.intact.to.sink(G, sink = NULL) size.intact.to.node(G, node = NULL)

Arguments

  • G: A graph object of class "igraph", see graph_from_literal
  • sink: The sink node of G.
  • node: A node of interest. If node = "all", the index will be computed for all nodes.

Returns

Returns the size of the graph or subgraph whose downstream end (outlet) is a node of interest.

Author(s)

Ken Aho, Gabor Csardi wrote several important function components including subgraph.

Examples

# Murphy Cr. disconnected network, no arc from M1799 to M1719! G <- graph_from_literal(IN_N --+ M1984 --+ M1909, IN_S --+ M1993 --+ M1951, M1951 --+ M1909 --+ M1799, M1719 --+ M1653 --+ M1572 --+ M1452 --+ M1377, M1377 --+ M1254 --+ M1166 --+ M1121 --+ M1036 --+ M918 --+ M823 --+ M759, M759 --+ M716 --+ M624 --+ M523 --+ M454 --+ M380 --+ M233 --+ M153 --+ M91, M91 --+ OUT) data(mur_coords) # coordinate data spatial.plot(G, mur_coords[,2], mur_coords[,3], names = mur_coords[,1]) data(mur_lengths) # segment length data lengths_new <- mur_lengths[-7,] # Drop M1799 -> M1719 arc length E(G)$weight <- lengths_new[,2] # units are in meters size.intact.to.node(G, node = "all") size.intact.to.sink(G, sink = "OUT") # same as output below: size.intact.to.node(G, node = "OUT")
  • Maintainer: Ken Aho
  • License: GPL (>= 2)
  • Last published: 2025-01-14

Useful links