Learn R Programming

riverdist (version 0.17.0)

buildlookup: Build Lookup Tables for Fast Distance Computation

Description

Adds lookup tables for distance computation, dramatically reducing computation time. It may take some time to calculate, particularly in a braided network.

Usage

buildlookup(rivers)

Value

A rivernetwork object, with a new list element, $distlookup, a list of three matrices. Element [i,j] of each matrix corresponds to the route between segment i and j. The

distlookup$middist matrix gives the total distance of the "middle" of each route (between the starting and ending segments"), and the

distlookup$starttop and distlookup$endtop matrices have value

TRUE, FALSE, or NA if the segments at the beginning or end of the route are connected to the rest of the route at the top of the coordinate matrix, bottom of the coordinate matrix, or if the route is contained to just one segment, respectively. (See rivernetwork.)

Arguments

rivers

The river network object to use

Author

Matt Tyers

Examples

Run this code
data(abstreams)

abstreams1 <- buildlookup(abstreams)

Run the code above in your browser using DataLab