error in krig interpolation
el1 is already a SpatialPointsDataFrame, so omit the locations argument. You may try something as simple as zz <- krige(log(z) ~ 1, el1, mask_SG, efitted) -- Edzer
temiz wrote:
when does this error occur ?
> zz <- krige(formula = log(el1$z) ~ 1, locations = ~x+y , data = el1
,newdata = mask_SG , model = efitted) Error in function (classes, fdef,
mtable) :
unable to find an inherited method for function "coordinates<-",
for signature "SpatialPointsDataFrame"
str(el1) gives:
Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
..@ data :'data.frame': 24051 obs. of 4 variables:
.. ..$ cat: num [1:24051] 1 2 3 4 5 6 7 8 9 10 ...
.. ..$ x : num [1:24051] 449114 449204 449262 449263 449276 ...
.. ..$ y : num [1:24051] 4590406 4590375 4590117 4590304 4590214 ...
.. ..$ z : num [1:24051] 110 110 110 110 110 110 110 110 110 110 ...
..@ coords.nrs : num(0)
..@ coords : num [1:24051, 1:2] 449114 449204 449262 449263 449276 ...
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : NULL
.. .. ..$ : chr [1:2] "coords.x1" "coords.x2"
..@ bbox : num [1:2, 1:2] 449083 4584531 456552 4591890
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:2] "coords.x1" "coords.x2"
.. .. ..$ : chr [1:2] "min" "max"
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
.. .. ..@ projargs: chr " +proj=utm +zone=36 +ellps=intl +units=m
+no_defs"
regards