Learn R Programming

SSN (version 1.1.8)

FCSD01: Empirical Semivariogram Using Hydrologic Distance Between Neighboring Flow-connected Sites

Description

FCSD01 computes the empirical semivariogram from the data based on hydrologic distance among sites only between and within neighboring reaches that are flow-connected by network.

Usage

FCSD01(object, ResponseName, breaks, ReachNei, ...)

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.
ReachNei
A sparse matrix containing information on which stream segments are neighbors. It is created with the reachNeiSSN function.
...
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-connected sites only. The data.frames have the following columns:

Details

The FCSD01 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-connected sites. The second list item is a vector of the breaks used to create the distance classes. The output is of class FCSD01.

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)
	# create neighborhood matrix
	neiMat = reachNeiSSN(mf04p)
  # compute FCSD01
  vout = FCSD01(mf04p, 'Summer_mn', breaks = fubrks, ReachNei = neiMat, 
	  include.lowest = TRUE)
  str(vout)

Run the code above in your browser using DataLab