Dear list:

I would like to compute the weights in Ordinary Kriging.
I try to predict only in one point, and know the OK weights but I have the following error (please, see ## (1)  ##).
Also, I try to reply the example code but I have some errors (please, see ## (2)  ##)

I am using  geoR version 1.7-2 and R-2.15.0 (RGui 32 bit). I have updated right now both (geoR and R software) because I trought that my version was obsoleted.

Thanks in advance,
Gema



## (1)  ## -------------------------------------------------------
library(geoR)
coord=read.table("examp_1_coord.txt",  header=TRUE)
datos=read.table("examp1_datos.txt",  header=TRUE)

objeto<-cbind(coord,datos)
examp.2<-as.geodata(obj=objeto,coords.col = 1:2, data.col = 3)
plot(examp.2, scatter3d=TRUE)

loci <- c(0.5, 0.5)
kc.examp.2<- krige.conv(examp.2, coords = examp.2$coords, 
          data = examp.2$data, loc=loci, krige=krige.control(cov.model="spherical", 
          cov.pars=c(5, 2), nugget= 0.0,lambda=1))
w1 <- krweights(examp.2$coords, loc=loci, krige=kc.examp.2)

>Error en match.arg(names(krige.user)[i], krige.names) : 
  'arg' should be one of “type.krige”, “trend.d”, “trend.l”, “obj.model”, “beta”, “cov.model”, “cov.pars”, “kappa”, “nugget”, “micro.scale”, “dist.epsilon”, “lambda”, “aniso.pars”
> 
## ---------------------------------------------------------




## (2)  ## -------------------------------------------------------
## Figure 8.4 in Webster and Oliver (2001), see help(wo)
> attach(wo)
The following object(s) are masked _by_ '.GlobalEnv':

    coords, data, x1
The following object(s) are masked from 'wo (position 3)':

    coords, data, x1, x2
> par(mfrow=c(2,2))
> plot(c(-10,130), c(-10,130), ty="n", asp=1)
> points(rbind(coords, x1))
Error en xy.coords(x, y) : 
  el objeto (list) no puede ser coercionado a 'double'
> KC1 <- krige.control(cov.pars=c(0.382,90.53))
> w1 <- krweights(wo$coords, loc=x1, krige=KC1)
Error en loccoords(coords = coords, locations = locations) : 
  coords and locations must have two columns
> text(coords[,1], 5+coords[,2], round(w1, dig=3))
Error en as.graphicsAnnot(labels) : objeto 'w1' no encontrado
## ---------------------------------------------------------













Gema Fernández-Avilés 

Department of Statistics
Faculty of Law and Social Sciences
University of Castilla-La Mancha at Toledo

http://www.uclm.es/profesorado/gemafaviles/

	[[alternative HTML version deleted]]

