FUDJ: Empirical Semivariogram Using Hydrologic Distance to Nearest...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/FUDJ.R

Description

FUDJ computes the empirical semivariogram from the data based on hydrologic distance to nearest common junctin between flow-unconnected sites by network.

Usage

1
FUDJ(object, ResponseName, breaks, ...)

Arguments

object

an object of class SpatialStreamNetwork-class or influenceSSN-class

ResponseName

a response or residual variable name in the data.frame of observed data in the SpatialStreamNetwork or influenceSSN object.

breaks

either a numeric vector of two or more unique cut points or a single number (greater than or equal to 2) giving the number of intervals into which the response values are to be cut.

...

further arguments passed from the cut function.

Details

The FUDJ function creates a list of two items. The first is another list of data.frames containing hydrologic distances by classing pairs of points into asymmetric distance classes to a common junction, and then computing empirical semivariogram values, along with number of pairs of points in each bin, for flow-unconnected sites. The second list item is a vector of the breaks used to create the distance classes. The output is of class FUDJ.

Value

A list of two items. The first is another list of data.frames (one for each network) describing the semivariance values for each bin and the hydrologic distances and number of pairs used to estimate those values. Computed for flow-unconnected sites only. The data.frames have the following columns:

brkLong

a factor variable with labels showing the upper and lower bounds for each break class in the longer distance to the common junction for flow-unconnected sites.

distLong

the mean hydrologic distance for the longer of two distances to common junction of pairs of flow-unconnected sites used to calculate the semivariance for each bin

brkShrt

a factor variable with labels showing the upper and lower bounds for each break class in the shorter distance to the common junction for flow-unconnected sites.

distShrt

the mean hydrologic distance for the shorter of two distances to common junction of pairs of flow-unconnected sites used to calculate the semivariance for each bin

semivar

the mean semivariance for flow-unconnected sites in each bin

covar

the mean empirical covariance for flow-unconnected sites in each bin

np

the number of pairs of flow-unconnected sites used to calculate the semivariance or covariance for each bin

Author(s)

Jay Ver Hoef support@SpatialStreamNetworks.com

See Also

The cut function is used to create distance classes. The Torgegram function computes semivariance values for both flow-connected and flow-unconnected that are pooled across networks.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  library(SSN)
  # NOT RUN 
  #mf04p <- importSSN(system.file("lsndata/MiddleFork04.ssn", 
  #  package = "SSN"), predpts = "pred1km", o.write = TRUE)
  #  use SpatialStreamNetwork object mf04p that was already created
  data(mf04p)
  #make sure mf04p has the correct path, will vary for each users installation
  mf04p@path <- system.file("lsndata/MiddleFork04.ssn", package = "SSN")
  #get maximum stream distance among sampled points
  Ds = getStreamDistMat(mf04p)
  DsNet1 = Ds$dist.net1 + t(Ds$dist.net1)
  DsNet2 = Ds$dist.net2 + t(Ds$dist.net2)
  max(DsNet1,DsNet2)
  #set number of lags
  nbrksfu = 8
  # set maximum lag
  maxbrksfu = 15000
  # create breaks
  fubrks = c(-.001, (1:nbrksfu)/nbrksfu*maxbrksfu)
  vout = FUDJ(mf04p, 'Summer_mn', breaks = fubrks, include.lowest = TRUE)
  str(vout)

jayverhoef/fluvgrm documentation built on Jan. 20, 2020, 7:54 p.m.