Calculate geostatistical distances (Ghosh-distances) between areas
# S3 method for rtop
gDist(object, params = list(), ...)
# S3 method for SpatialPolygonsDataFrame
gDist(object, object2 = NULL, ...)
# S3 method for SpatialPolygons
gDist(object, object2 = NULL, ...)
# S3 method for list
gDist(object, object2 = NULL, diag = FALSE, debug.level = 0, ...)
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.
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)
a set of parameters, used to modify the default parameters for
the rtop
package, set in getRtopParams
. The argument params can also be used
for the other methods, through the ...-argument.
an object of same type as object
, except for rtop
;
for calculation of geostatistical
distances also between the elements in the two different objects
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 = 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
Jon Olav Skoien
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.
Skoien, J. O., Bloschl, G., Laaha, G., Pebesma, E., Parajka, J., Viglione, A., 2014. Rtop: An R package for interpolation of data with a variable spatial support, with an example from river networks. Computers & Geosciences, 67.
# \donttest{
rpath = system.file("extdata",package="rtop")
library(sf)
observations = st_read(rpath, "observations")
gDist = gDist(observations)
# }
Run the code above in your browser using DataLab