swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: 92356fe3948f2370f8e5c4551ed82603ec7fafb1 authored by Edzer Pebesma on 04 October 2010, 00:00:00 UTC
version 0.9-72
version 0.9-72
Tip revision: 92356fe
variogramLine.R
# $Id: variogramLine.q,v 1.4 2008-08-18 16:32:42 edzer Exp $
"variogramLine" <-
function(object, maxdist, n = 200, min=1.0e-6 * maxdist, dir = c(1,0,0),
covariance = FALSE, ..., dist_vector = numeric(0), debug.level = 0)
{
if (missing(object))
stop("model is missing");
if (!inherits(object, "variogramModel"))
stop("model should be of mode variogramModel (use function vgm)")
if (length(dist_vector) > 0)
maxdist = 0.0
else if (missing(maxdist))
stop("maxdist or dist_vector needs to be set");
if (length(dir) != 3)
stop("dir should be numeric vector of length 3")
.Call("gstat_init", as.integer(debug.level))
pars = c(min,maxdist,n,dir)
load.variogram.model(object, c(0,0)) # loads object into gstat
ret = .Call("gstat_variogram_values", as.integer(c(0,0)),
as.numeric(pars), as.integer(covariance), as.numeric(dist_vector))
.Call("gstat_exit", 0);
if (is.matrix(dist_vector))
matrix(ret[[2]], nrow(dist_vector), ncol(dist_vector))
else
data.frame(dist=ret[[1]], gamma=ret[[2]])
}
"variogram.line" <- function(..., deprecate = FALSE) {
if (deprecate)
cat("variogram.line is DEPRECATED, please use variogramLine instead\n")
variogramLine(...)
}