FUSD: Empirical Semivariogram Using Hydrologic Distance Between...

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

View source: R/FUSD.R

Description

FUSD computes the empirical semivariogram from the data based on hydrologic distance between flow-unconnected sites by network.

Usage

1
FUSD(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 FUSD function creates a list of two items. The first is another list of data.frames containing hydrologic distances and 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 FUSD.

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:

brkClass

a factor variable with labels showing the upper and lower bounds for each break class.

brkDist

the mean hydrologic distance separating pairs of flow-connected 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 = 6
  # set maximum lag
  maxbrksfu = 22000
  # create breaks
  fubrks = c(-.001, (1:nbrksfu)/nbrksfu*maxbrksfu)
  vout = FUSD(mf04p, 'Summer_mn', breaks = fubrks, include.lowest = TRUE)
  str(vout)

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