[R-sig-Geo] universal kriging gives error

Edzer J. Pebesma e.pebesma at geo.uu.nl
Fri Apr 13 09:19:53 CEST 2007


temiz wrote:
> hello
>
> when I try universal kriging, it gives this error:
>
>  > v.trend <- variogram(z~x+y,el4)
>  > new.fit <- fit.variogram(v.trend, vgm(1,"Exp",300,1))
>  > krige(el4$z~el4$x+el4$y,el4, model=new.fit, newdata=mask_SG)
> Error in gstat.formula.predict(d$formula, newdata, na.action = na.action) :
>         NROW(locs) != NROW(X): this should not occur
> In addition: Warning messages:
> 1: 'newdata' had 42705 rows but variable(s) found have 7998 rows
> 2: 'newdata' had 42705 rows but variable(s) found have 7998 rows
>
> regards
>
>   
Please use the form

krige(z~x+y, el4, mask_SG, new.fit)

as x+y need to be resolved from both el4 and mask_SG -- how to get 
coordinates named el4$x from mask_SG otherwise?
--
Edzer




More information about the R-sig-Geo mailing list