rtopVariogram: create variogram for data with spatial support

View source: R/zzz.R

rtopVariogramR Documentation

create variogram for data with spatial support

Description

rtopVariogram will create binned variogram or cloud variogram of data with an areal support.

Usage

## S3 method for class 'rtop'
rtopVariogram(object, params = list(), ...) 
## S3 method for class 'SpatialPolygonsDataFrame'
rtopVariogram(object, ...) 
## S3 method for class 'SpatialPointsDataFrame'
rtopVariogram(object, formulaString, params=list(), cloud, 
                       abins, dbins, ...) 
## S3 method for class 'STSDF'
rtopVariogram(object, formulaString, params=list(), cloud, 
                       abins, dbins, data.table = FALSE, ...) 

Arguments

object

object of class rtop (see rtop-package) or a
SpatialPolygonsDataFrame or SpatialPointsDataFrame with information about observations. If
object is a
SpatialPointsDataFrame, it must have a column with name area.

formulaString

formula that defines the dependent variable as a linear model of independent variables; suppose the dependent variable has name z, for ordinary and simple kriging use the formula z~1; for universal kriging, suppose z is linearly dependent on x and y, use the formula z~x+y. The formulaString defaults to "value~1" if value is a part of the data set. If not, the first column of the data set is used.

params

a set of parameters, used to modify the default parameters for the rtop package, set in getRtopParams.

cloud

logical; if TRUE, calculate the semivariogram cloud, can be used to overrule the cloud parameter in params.

abins

possibility to set areal bins (not yet implemented)

dbins

possibility to set distance bins (not yet implemented)

data.table

an option to use data.table internally for the variogram computation for STSDF-objects

...

parameters to other functions called, e.g. gstat's variogram-function and to rtopVariogram.SpatialPointsDataFrame when the method is called with an object of a different class

Value

The function creates a variogram, either of type rtopVariogram or rtopVariogramCloud. This variogram is based on the variogram function from gstat, but has additional information about the spatial size or length of the observations. An rtop-object with the variogram added is returned if the function is called with an rtop-object as argument.

For spatio-temporal objects (STSDF), the variogram is the spatially variogram, averaged for all time steps. There is a possibility to use data.table internally in this function, which can improve computation time for some cases.

Note

The variogram cloud is similar to the variogram cloud from gstat, with the area/length added to the resulting data.frame. The binned variogram is also based on the area or length, in addition to the distance between observations. The bins equally distanced in the log10-space of the distances and areas (lengths). The size of the bins is decided from the parameters amul and dmul, defining the number of bins per order of magnitude (1:10, 10:100, and so on).

The distances between areas are in this function based on the centre of gravity.

Author(s)

Jon Olav Skoien

References

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

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.

Examples

## Not run: 
library(sf)
rpath = system.file("extdata",package="rtop")
observations = st_read(rpath,"observations")
# Create a column with the specific runoff:
observations$obs = observations$QSUMMER_OB/observations$AREASQKM

vario = rtopVariogram(observations, cloud = TRUE)

## End(Not run)

rtop documentation built on Nov. 2, 2023, 5:07 p.m.