Learn R Programming

riverdist (version 0.17.0)

riverdistancelist: Multiple River Distances

Description

Used to calculate a list of possible river distances, in the event of braiding. Calls routelist to detect a list of routes from one river location to another, and uses riverdistance to calculate the distances along those routes. Different routes are detected by randomly reordering the segment numbers of the input river network object, thus changing the internal hierarchy of segment selection.

Usage

riverdistancelist(startseg, endseg, startvert, endvert, rivers, reps = 100)

Value

A list with two objects, $routes being a list of detected routes in ascending order by distance, and $distances being the respective distances along the routes detected.

Arguments

startseg

Segment number of the start of the route

endseg

Segment number of the end of the route

startvert

Vertex number of the start of the route

endvert

Vertex number of the end of the route

rivers

The river network object to use

reps

Deprecated. Was the number of randomized reorderings to try.

Author

Matt Tyers

Examples

Run this code
data(KilleyW)
plot(x=KilleyW)

Killey.dists <- riverdistancelist(startseg=1, endseg=16, startvert=100, endvert=25,
   rivers=KilleyW)
Killey.dists  # 18 routes are detected.

# mapping the shortest route detected... 
riverdistance(startvert=100, endvert=25, path=Killey.dists$routes[[1]], rivers=KilleyW, map=TRUE)

# mapping the shortest longest detected... 
riverdistance(startvert=100, endvert=25, path=Killey.dists$routes[[18]], rivers=KilleyW, map=TRUE)

Run the code above in your browser using DataLab