Learn R Programming

rtop (version 0.5-5)

gDist: calculate geostatistical distances between areas

Description

Calculate geostatistical distances (Ghosh-distances) between areas

Usage

"gDist"(object, params = list(), ...) "gDist"(object, object2 = NULL, ...) "gDist"(object, object2 = NULL, ...) "gDist"(object, object2 = NULL, diag = FALSE, debug.level = 0, ...)

Arguments

object
object of class SpatialPolygons or SpatialPolygonsDataFrame with boundaries of areas; or list of discretized areas, typically from a call to rtopDisc; or object of class rtop with such boundaries and/or discretized elements (the individual areas)
params
a set of parameters, used to modify the standard parameters for the rtop package, set in getRtopParams. The argument params can also be used for the other methods, through the ...-argument.
object2
an object of same type as object, except for rtop; for calculation of geostatistical distances also between the elements in the two different objects
diag
logical; if TRUE only calculate the geostatistical distances between each element and itself, only when the objects are lists of discretized areas and object2 = object or object2 = NULL
debug.level
debug.level = 0 will suppress output from the call to varMat, done for calculation of the geostatistical distances
...
other parameters, for gDist.list when calling one of the other methods, or for varMat, in which the calculations take place

Value

If called with one list of discretized elements, a matrix with the geostatistical distances between the elements within the list. If called with two lists of discretized elements, a matrix with the geostatistical distances between the elements in the two lists. If called with diag = TRUE, the function returns an array of the geostatistical distance within each of the elements in the list.If called with one SpatialPolygons or SpatialPolygonsDataFrame or the function returns a list with one matrix with geostatistical distances between the elements of the object. If called with two objects, the list will also containt a matrix of the geostatistical distances between the elements of the two objects, and an array of the geostatistical distances within the elements of the second object.If called with an rtop-object, the function will return the object, amended with the list above.

References

Ghosh, B. 1951. Random distances within a rectangle and between two rectangles. Bull. Calcutta Math. Soc., 43, 17-24.

Gottschalk, L. 1993. Correlation and covariance of runoff. Stochastic Hydrology and Hydraulics, 7, 85-101.

Skoien, J. O., R. Merz, and G. Bloschl. 2006. Top-kriging - geostatistics on stream networks. Hydrology and Earth System Sciences, 10, 277-287.

Examples

Run this code
## Not run: 
# library(rgdal)
# rpath = system.file("extdata",package="rtop")
# observations = readOGR(rpath,"observations")
# gDist = gDist(observations)
# ## End(Not run)

Run the code above in your browser using DataLab