Usage
krige(formula, locations, ...)
krige.locations(formula, locations, data, newdata, model, ..., beta, nmax
= Inf, nmin = 0, maxdist = Inf, block, nsim = 0, indicators = FALSE,
na.action = na.pass)
krige.spatial(formula, locations, newdata, model, ..., beta, nmax
= Inf, nmin = 0, maxdist = Inf, block, nsim = 0, indicators = FALSE,
na.action = na.pass)
idw(formula, locations, ...)
idw.locations(formula, locations, data, newdata, nmax = Inf,
nmin = 0, maxdist = Inf, block, na.action = na.pass, idp = 2.0)
idw.spatial(formula, locations, newdata, nmax = Inf, nmin = 0,
maxdist = Inf, block = numeric(0), na.action = na.pass, idp = 2.0)
Arguments
formula
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 simple kriging also define be
locations
formula with only independent variables that define the
spatial data locations (coordinates), e.g. ~x+y
, or object of
class Spatial
data
data frame: should contain the dependent variable, independent
variables, and coordinates, should be missing if locations contains data.
newdata
data frame or Spatial object with prediction/simulation
locations; should
contain attribute columns with the independent variables (if present) and
(if locations is a formula) the coordinates with names as defined in locations
model
variogram model of dependent variable (or its residuals),
defined by a call to vgm or fit.variogram beta
only for simple kriging (and simulation based on simple
kriging); vector with the trend coefficients (including intercept);
if no independent variables are defined the model only contains an
intercept and this should be the simple kriging mean
nmax
for local kriging: the number of nearest observations that
should be used for a kriging prediction or simulation, where nearest
is defined in terms of the space of the spatial locations. By default,
all observations are used
nmin
for local kriging: if the number of nearest observations
within distance maxdist
is less than nmin
, a missing
value will be generated; see maxdist
maxdist
for local kriging: only observations within a distance
of maxdist
from the prediction location are used for prediction
or simulation; if combined with nmax
, both criteria apply
block
block size; a vector with 1, 2 or 3 values containing
the size of a rectangular in x-, y- and z-dimension respectively
(0 if not set), or a data frame with 1, 2 or 3 columns, containing
the points that discretize the block in the x-, y- and z-dimens
nsim
integer; if set to a non-zero value, conditional simulation
is used instead of kriging interpolation. For this, sequential Gaussian
or indicator simulation is used (depending on the value of
indicators
), following a single random path
indicators
logical, only relevant if nsim
is non-zero; if
TRUE, use indicator simulation; else use Gaussian simulation
na.action
function determining what should be done with missing
values in 'newdata'. The default is to predict 'NA'. Missing values
in coordinates and predictors are both dealt with.
...
other arguments that will be passed to gstat idp
numeric; specify the inverse distance weighting power