variogram(formula, data=<<see below>>, subset=<<see below>>, na.action=<<see below>>, lag=<<see below>>, nlag=20, tol.lag=lag/2, azimuth=0, tol.azimuth=90, bandwidth=1e21, maxdist=<<see below>>, minpairs=6, method="classical")
z ~ x + y
The
z
variable is a numeric response.
Variables
x
and
y
are the locations.
All variables in the formula must be vectors of equal length
with no missing values (
NA
s).
The formula may also contain expressions for the variables, e.g.
sqrt(count)
,
log(age+1)
or
I(2*x)
. (The
I()
is required since
the
*
operator has a special meaning on the right side of a formula.
The right hand side may also be a call to the
loc
function
e.g.
loc(x,y)
.
The
loc
function can be used to correct for geometric anisotropy,
see the
loc
help file.
formula
.
model.frame
after
any
subset
argument has been used.
The default (with
na.fail
) is to create an error
if any missing values are found.
A possible alternative is
na.omit
, which deletes observations
that contain one or more missing values.
lag
is set to
maxdist / nlag
.
tol.azimuth
of 90 or greater (the default) results in an omnidirectional
variogram.
np
) that must
be used in calculating a variogram value.
If
np
is less than
minpairs
then that value is dropped from the
variogram.
"classical"
for Matherons (1963) estimate and
"robust"
for Cressie and Hawkins (1980) robust estimator.
Only the first character of the string needs to be given.
"variogram"
that inherits from
"data.frame"
with
columns:
call
with an image of the call
that produced the object.
Method for class
"variogram"
include
plot
,
print
and
summary
.
The variogram is a measure of spatial correlation.
This function uses a modified version of the GSLIB subroutine gamv2
(Deutsch and Journel, 1992).
Cressie, Noel A. C. (1993).
Statistics for Spatial Data,
Revised Edition.
Wiley, New York.
Cressie, N. and Hawkins, D. M. (1980).
Robust estimation of the variogram.
Mathematical Geology
12, 115-125.
Deutsch, Clayton V. and Journel, Andre G. (1992).
GSLIB Geostatistical Software Library and User's Guide.
Oxford University Press, New York.
Matheron, G. (1963).
Principles of geostatistics.
Economic Geology
58, 1246-1266.
# an omnidirectional variogram v1 <- variogram(ore ~ easting + northing, data=iron.ore) plot(v1) # variograms in 0, 45, 90 and 135 degrees directions v2 <- variogram(ore ~ loc(easting,northing), data=iron.ore, azimuth=c(0,45,90,135), tol.azimuth=22.5) plot(v2)