correlogram(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) covariogram(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)
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.
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 correlogram.
np
)
that must be used in calculating a correlogram or covariogram value.
If
np
is
less than
minpairs
then that value is dropped from the result.
"correlogram"
or
"covariogram"
that inherits
from "
variogram
"
and
"data.frame"
with columns:
correlogram
was called).
covariogram
was called).
call
with an image of the call that produced the object.
There are plot methods for classes
"correlogram"
and
"covariogram"
.
The
print
and
summary
methods for class
"variogram"
can be used
through inheritance.
The covariogram is a measure of spatial covariance as a function of
distance.
The correlogram is a standardized covariogram where the values are between
-1 and 1.
These functions make a call to the function
variogram
with the argument
type
set to
"correlogram"
or
"covariogram"
.
The computations are based on a modified version of the gamv2 subroutine
from GSLIB (Deutsch and Journel, 1992).
Cressie, Noel A. C. (1993). Statistics for Spatial Data, Revised Edition. Wiley, New York.
Deutsch, Clayton V. and Journel, Andre G. (1992). GSLIB Geostatistical Software Library and User's Guide. Oxford University Press, New York.
# an omnidirectional correlogram c1 <- correlogram(log(tcatch+1) ~ lat + long, data=scallops) plot(c1) # correlograms in 0, 45, 90 and 135 degrees directions c2 <- correlogram(log(tcatch+1) ~ loc(lat,long), data=scallops, azimuth=c(0,45,90,135), tol.azimuth=22.5) plot(c2)