net.maxupslope {stream.net} | R Documentation |
Compute the asymmetric maximum upslope matrix for stream segments.
net.maxupslope (net, slopes)
net |
A net.object . |
slopes |
vector of "slopes" in segment order. |
Uses the distance matrix algorithm to calculate the maximum upstream slope between two segments. The maximum is the maximum of the slopes of all segments between the two segments, not including either of them. The matrix is read from row to column, i.e., the maximum slope from segment 1 to segment 3 is in row 1, column 3.
The function was written for application to topographic slope but any other attribute could be used of course.
A square matrix of dimension the number of segments.
Denis White, white.denis@epa.gov
# Q model random net net <- net.qmodel (5) # add segments net <- net.addsegs (net) # upslope distance matrix slopes <- max (net$links$shreve) - net$links$shreve[net$segs$link] slopes <- sapply (slopes + round (runif (nrow (net$segs)), 2), function (x) max (0, x)) net.map (net, segatt=slopes) slopemat <- net.maxupslope (net, slopes=slopes)