[R-sig-Geo] !SPAM: row.names of data and coords do not match

Els Ducheyne educheyne at avia-gis.be
Thu Dec 9 11:06:20 CET 2010

Dear list
I am using gstat version 0.9-69 and sp 0.9-65 in R 2.11.1 Leopard build 32-bit

I am kriging a surface from point observations. The kriged surface is generated without problems. However when I try to crossvalidate I get the following error:
ph.ok .cv<- krige.cv(AVE_MEAN~1,ph,vt.fit)
Error in SpatialPointsDataFrame(coordinates(data), data.frame(matrix(as.numeric(NA),  : 
 row.names of data and coords do not match

where ph a SpatialPointsDataFrame, AVE_MEAN is the parameter to krige and a column in ph, and vt.fit is the fitted variogram
> summary(ph)
Object of class SpatialPointsDataFrame
              min      max
coords.x1  2.62289  6.13355
coords.x2 49.74510 51.50510
Is projected: FALSE 
proj4string :
[+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0]
Number of points: 67
Data attributes:
   MAX_MEAN       MIN_MEAN        AVE_MEAN       predicted     
Min.   :2005   Min.   :7.147   Min.   :7.066   Min.   : 7.096  
1st Qu.:2007   1st Qu.:7.738   1st Qu.:7.640   1st Qu.: 7.601  
Median :2008   Median :7.885   Median :7.740   Median : 7.729  
Mean   :2007   Mean   :7.888   Mean   :7.748   Mean   : 7.741  
3rd Qu.:2008   3rd Qu.:8.069   3rd Qu.:7.857   3rd Qu.: 7.876  
Max.   :2008   Max.   :8.560   Max.   :8.528   Max.   : 8.333  
                                               NA's   :19.000 

I have come across a message where it was stated that the locations should be coerced into a separate object but i have not idea how to implement this
Any ideas
Thanks in advance

More information about the R-sig-Geo mailing list