Learn R Programming

smnet (version 2.1.2)

get_adjacency: Construct a Stream Network Adjacency Matrix

Description

Builds a sparse adjacency matrix from a user specified SSN data directory, by extracting and processing the binaryID.db table. The resulting output of this function is required input for fitting spatial additive network models to SSN objects using the main smnet function.

Usage

get_adjacency(ssn_directory, netID = 1)

Arguments

ssn_directory

Required character string indicating the path to the location of the .ssn directory which contains the binaryID.db table.

netID

Logical. Integer specifying the particular stream network of interest within the SSN object. Defaults to 1.

Value

List object with components

  • adjacency: Sparse adjacency matrix of class spam with row and column dimension equal to the number of stream segments. If the i^th column has non-zero elements \(j_1\) and \(j_2\) then this indicates that \(j_1\) and \(j_2\) are direct upstream neighbours of i. If the \(i^\textrm{th}\) column has sum 1, then this indicates that \(i\) has only one upstream neighbour, and therefore no confluence lies between them; by default the spatial penalties treat these differently.

  • bid: Character vector of binary identifiers for each stream segment, used only for automatic calculation of Shreve's stream order within smnet

See Also

smnet, plot.smnet, predict.smnet