variogram.formula(object, ...)
variogram.gstat(formula, locations, data, ...)
variogram.default(y, locations, X, cutoff, width = cutoff/15, alpha =
0, beta = 0, tol.hor = 90/length(alpha), tol.ver =
90/length(beta), cressie = FALSE, dX = numeric(0), boundaries =
numeric(0), cloud = FALSE, trend.beta = NULL, debug.level = 1,
cross = TRUE, grid, map = FALSE, g = NULL, ...)print.gstatVariogram(v, ...)
print.variogramCloud(v, ...)
gstat
; in this form, direct
and cross (residual) variograms are calculated for all variables and
variable pairs defined in object
z~1
~x+y
; see examples.For variogram.default: list with coordinate matrices, each with the number of
gstat
and has more than one variablevariogram
or variogramCloud
to be printedcutoff
and width
are given, a variogram map is returned. This requires package
sp. Alternatively, a map can be passed, of class SpatialDataFrameGrid
(see sp docs)In other cases, an object of class "gstatVariogram" with the following fields:
variogramCloud
see belowvariogramCloud
, with the field
np
encoding the numbers of the point pair that contributed to a
variogram cloud estimate, as follows. The first point is found by the
integer division of np by $2^{16}$, the second point by the remainder
of that division. print.variogramCloud shows no np
field,
but does show in addition:Pebesma, E.J., 2004. Multivariable geostatistics in S: the gstat package. Computers & Geosciences, 30: 683-691.
data(meuse)
# no trend:
variogram(log(zinc)~1, loc=~x+y, meuse)
# residual variogram w.r.t. a linear trend:
variogram(log(zinc)~x+y, loc=~x+y, meuse)
# directional variogram:
variogram(log(zinc)~x+y, loc=~x+y, meuse, alpha=c(0,45,90,135))
# GLS residual variogram:
v = variogram(log(zinc)~x+y,~x+y,meuse)
v.fit = fit.variogram(v, vgm(1, "Sph", 700, 1))
v.fit
set = list(gls=1)
v
g = gstat(NULL, "log-zinc", log(zinc)~x+y,~x+y, meuse, model=v.fit, set = set)
variogram(g)
Run the code above in your browser using DataLab