net.dist {stream.net} | R Documentation |
Compute the asymmetric distance matrix for stream segments. Upstream and downstream distances are included separately.
net.dist (net, ends=0.5, method="coordinate", digits=10)
net |
A net.object . |
ends |
how to handle from and to segments
if ends=0 , do not use from and to lengths
if ends=1 , use total of from and to lengths
if ends=0.5 , use half of from and to lengths. |
method |
method="coordinate" means network
coordinate distance; method="segment" means
distance in number of segments. |
digits |
if digits=NULL , do not round output
matrix, else precision of rounding. |
Upstream distances are found by indexing the source segment by its row and the destination segment by its column. Downstream distances are the opposite; the source is the column and the destination is the row.
Algorithm adapted from that of SG Leibowitz. This algorithm does produce roundoff residue and thus the matrix can be purged of very small non-zero values with rounding.
A square matrix of dimension the number of segments.
Denis White, white.denis@epa.gov
net.object
net.total.dist
net.dir
net.prox
# Q model random net net <- net.qmodel (10) # add segments net <- net.addsegs (net) # distance matrix net.map (net, segatt=round (net$segs$length, 2)) dmat <- net.dist (net, ends=0.5, method="coordinate") hist (dmat, col="gray", main="One Way Distances")