[R-sig-Geo] krige.cv

Francois JOUVIE francois.jouvie at supelec.fr
Wed Sep 17 17:16:45 CEST 2008


Please,

Again, a question about the underlying process of krige.cv :

I have a set of 42 values at different coordinates points (x,y,z) in  
3D space.
I put an arbitrary model of variogram and I do a cross validation.

This below is working:

datacv<-read.table("/Users/fj/Desktop/septembre 08/ 
DonK3D_elev.txt",header=TRUE)
 > m1<-vgm(4,"Exp",2500)
 > x<-krige.cv(modE~1,~x+y+z,data=datacv,model=m1)
[using ordinary kriging]
[using ordinary kriging]
[using ordinary kriging]
[using ordinary kriging]

..... 42 times.

Now, if I had to define the coordinates in a previous work (to do a  
variogram by example), I can't do the cross validation because there  
is an ambiguity with these coordinates. By example:

datacv<-read.table("/Users/fj/Desktop/septembre 08/ 
DonK3D_elev.txt",header=TRUE)
coordinates(datacv)<-~x+y+z
 > m1<-vgm(4,"Exp",2500)
 > x<-krige.cv(modE~1,~x+y+z,data=datacv,model=m1)
Erreur dans `coordinates<-`(`*tmp*`, value = ~x + y + z) :
   setting coordinates cannot be done on Spatial objects, where they  
have already been set

This command neither do not work:

x<-krige.cv(modE~1,data=datacv,model=m1)
Erreur dans function (classes, fdef, mtable)  :
   unable to find an inherited method for function "krige.cv", for  
signature "formula", "missing"
 >
How to use the coordinates when they are known  (I have not a such  
problem with the krige command alone...?)

Thanks you very much

Francois




More information about the R-sig-Geo mailing list