Learn R Programming

SSN (version 1.1.8)

FUSD: Empirical Semivariogram Using Hydrologic Distance Between Flow-unconnected Sites

Description

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

Usage

FUSD(object, ResponseName, breaks, ...)

Arguments

object
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.

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:

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.

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

Run this code

  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)

Run the code above in your browser using DataLab