swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: 48d0b1457c4d7f60524adbe61de8b574c2eb3cc6 authored by Edzer Pebesma on 22 June 2012, 17:21:36 UTC
version 1.0-12
version 1.0-12
Tip revision: 48d0b14
krige.R
# $Id: krige.q,v 1.15 2009-02-20 13:53:38 edzer Exp $
if (!isGeneric("krige"))
setGeneric("krige", function(formula, locations, ...)
standardGeneric("krige"))
"krige.locations" <-
function (formula, locations, data = sys.frame(sys.parent()),
newdata, model = NULL, ..., beta = NULL, nmax = Inf, nmin = 0, omax = 0,
maxdist = Inf, block = numeric(0), nsim = 0, indicators = FALSE,
na.action = na.pass, debug.level = 1)
{
g = gstat(formula = formula, locations = locations, data = data,
model = model, beta = beta, nmax = nmax, nmin = nmin, omax = omax,
maxdist = maxdist, ...)
predict.gstat(g, newdata = newdata, block = block, nsim = nsim,
indicators = indicators, na.action = na.action, debug.level = debug.level)
}
setMethod("krige", c("formula", "formula"), krige.locations)
krige.spatial <- function(formula, locations, newdata, model = NULL, ...,
beta = NULL, nmax = Inf, nmin = 0, omax = 0, maxdist = Inf,
block = numeric(0), nsim = 0, indicators = FALSE,
na.action = na.pass, debug.level = 1)
{
# locations = coordinates(arg2)
g = gstat(formula = formula, # locations = locations,
data = locations,
model = model, beta = beta, nmax = nmax, nmin = nmin, omax = omax,
maxdist = maxdist, ...)
predict.gstat(g, newdata = newdata, block = block, nsim = nsim,
indicators = indicators, na.action = na.action, debug.level = debug.level)
}
setMethod("krige", c("formula", "Spatial"), krige.spatial)
setMethod("krige", c("formula", "NULL"), krige.spatial)
if (!isGeneric("idw"))
setGeneric("idw", function(formula, locations, ...)
standardGeneric("idw"))
idw.locations <-
function (formula, locations, data = sys.frame(sys.parent()),
newdata, nmax = Inf, nmin = 0, omax = 0, maxdist = Inf,
block = numeric(0),
na.action = na.pass, idp = 2.0, debug.level = 1) {
krige(formula, locations, data, newdata, nmax = nmax, nmin = nmin,
omax = omax, maxdist = maxdist, block = block, na.action = na.action,
set = list(idp = idp), debug.level = debug.level)
}
setMethod("idw", c("formula", "formula"), idw.locations)
idw.spatial <-
function (formula, locations,
newdata, nmax = Inf, nmin = 0, omax = 0,
maxdist = Inf, block = numeric(0),
na.action = na.pass, idp = 2.0, debug.level = 1) {
krige(formula, locations, newdata, nmax = nmax, nmin = nmin, omax = omax,
maxdist = maxdist, block = block, na.action = na.action,
set = list(idp = idp), debug.level = debug.level, model = NULL)
}
setMethod("idw", c("formula", "Spatial"), idw.spatial)