rtopVariogram will create binned variogram or cloud variogram of data with an areal support.
# S3 method for rtop
rtopVariogram(object, params = list(), ...)
# S3 method for SpatialPolygonsDataFrame
rtopVariogram(object, ...)
# S3 method for SpatialPointsDataFrame
rtopVariogram(object, formulaString, params=list(), cloud,
abins, dbins, ...)
# S3 method for STSDF
rtopVariogram(object, formulaString, params=list(), cloud,
abins, dbins, data.table = FALSE, ...)
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.
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
.
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.
a set of parameters, used to modify the default parameters for
the rtop
package, set in getRtopParams
.
logical; if TRUE, calculate the semivariogram cloud, can be used to overrule the cloud parameter in params.
possibility to set areal bins (not yet implemented)
possibility to set distance bins (not yet implemented)
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
Jon Olav Skoien
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.
if (FALSE) {
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)
}
Run the code above in your browser using DataLab