net.interp {stream.net} | R Documentation |
Create an attribute for stream segments that is interpolated from data provided for a subset of segments.
net.interp (net, dist, samples, predict=NULL, maxdist=1e32, method="inverseDistance", power=2, vector=TRUE, name=NULL)
net |
A net.object . |
dist |
an upstream/downstream distance matrix from
net.dist , probably using ends=0.5 ,
and possibly using method="segment" . |
samples |
two column matrix or data frame with first
column/field sid s to segments of sampled data and
second column/field the sampled data values. |
predict |
vector of segments to which to predict,
unless NULL , in which case predict to all other
segments. |
maxdist |
maximum distance (in method units)
for neighborhood. |
method |
only "inverseDistance" currently
implemented. |
power |
exponent for method="inverse distance"
function. |
vector |
if TRUE , return a vector else a field
in $segs . |
name |
name of the attribute to be added
(if ! vector) ). |
Uses total distances, ignoring upstream/downstream.
If vector
is TRUE, then a vector of the attribute
values in segment order, else a net.object
with the attribute added to $segs
.
Denis White, white.denis@epa.gov
# Q model random net net <- net.qmodel (10) dmat <- net.dist (net, ends=0.5, method="segment") # interpolation samples <- matrix (c(2, 4, 6, 10, 5, 1), ncol=2) y <- net.interp (net, dmat, samples, power=0.25) net.map (net, segatt=round (y, 1))