Modérateur : Groupe des modérateurs
Code : Tout sélectionner
> is.element
function (el, set)
match(el, set, 0) > 0
<environment: namespace:base>
Code : Tout sélectionner
> AIC
function (object, ..., k = 2)
UseMethod("AIC")
<environment: namespace:stats>
> methods(AIC)
[1] AIC.default* AIC.logLik*
Non-visible functions are asterisked
> AIC.logLik
Erreur : objet "AIC.logLik" non trouvé
> stats:::AIC.logLik
function (object, ..., k = 2)
-2 * c(object) + k * attr(object, "df")
<environment: namespace:stats>
Code : Tout sélectionner
> gstat:::krige.spatial
function (formula, locations, newdata, model = NULL, ..., beta = NULL,
nmax = Inf, nmin = 0, maxdist = Inf, block = numeric(0),
nsim = 0, indicators = FALSE, na.action = na.pass, debug.level = 1)
{
g = gstat(formula = formula, data = locations, model = model,
beta = beta, nmax = nmax, nmin = nmin, maxdist = maxdist,
...)
predict.gstat(g, newdata = newdata, block = block, nsim = nsim,
indicators = indicators, na.action = na.action, debug.level = debug.level)
}
<environment: namespace:gstat>
Code : Tout sélectionner
> predict.gstat
function (object, newdata, block = numeric(0), nsim = 0, indicators = FALSE,
BLUE = FALSE, debug.level = 1, mask, na.action = na.pass,
sps.args = list(n = 500, type = "regular", offset = c(0.5,
0.5)), ...)
{
if (missing(object) || length(object$data) < 1)
stop("no data available")
if (!inherits(object, "gstat"))
stop("first argument should be of class gstat")
if (!is.null(object$locations) && inherits(object$locations,
"formula") && !(is(newdata, "Spatial"))) {
coordinates(newdata) = object$locations
return.sp = FALSE
}
...
Thomas Galtier a écrit :En fait dans les packages que j'ai en .zip ... ça retourne automatiquement à l'aide en ligne ...
Moi j'aimerai vraiment le code source de la fonction ...
Là j'y arrive pas ...
:cry:
Code : Tout sélectionner
# $Id: krige.q,v 1.14 2007-02-27 22:09:32 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,
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,
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, 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,
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, maxdist = Inf, block = numeric(0),
na.action = na.pass, idp = 2.0) {
krige(formula, locations, data, newdata, nmax = nmax, nmin = nmin,
maxdist = maxdist, block = block, na.action = na.action,
set = list(idp = idp))
}
setMethod("idw", c("formula", "formula"), idw.locations)
idw.spatial <-
function (formula, locations,
newdata, nmax = Inf, nmin = 0, maxdist = Inf, block = numeric(0),
na.action = na.pass, idp = 2.0) {
krige(formula, locations, newdata, nmax = nmax, nmin = nmin,
maxdist = maxdist, block = block, na.action = na.action,
set = list(idp = idp), model = NULL)
}
setMethod("idw", c("formula", "Spatial"), idw.spatial)
Retourner vers « Questions en cours »
Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 1 invité