net.interp {stream.net}R Documentation

Interpolate Sparse Attribute to all Stream Segments

Description

Create an attribute for stream segments that is interpolated from data provided for a subset of segments.

Usage

  net.interp (net, dist, samples, predict=NULL, 
    maxdist=1e32, method="inverseDistance", power=2, 
    vector=TRUE, name=NULL)

Arguments

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 sids 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)).

Details

Uses total distances, ignoring upstream/downstream.

Value

If vector is TRUE, then a vector of the attribute values in segment order, else a net.object with the attribute added to $segs.

Author(s)

Denis White, white.denis@epa.gov

See Also

net.object net.dist

Examples

  # 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))

[Package stream.net version 1.0.6 Index]