riverdistancelist: Multiple River Distances

View source: R/detectbraiding.R

riverdistancelistR Documentation

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)

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.

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.

Note

Since this function uses randomization, there is no guarantee that the list of routes will be comprehensive. Larger numbers of reps can be tried, but computation can be slow, particularly in the presence of a complex river network. It may be advantageous to use trimriver to create a smaller, more specific river network object to work with.

Author(s)

Matt Tyers

Examples

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)

mbtyers/riverdist documentation built on Jan. 16, 2024, 12:34 a.m.