Search code examples
rmapsinterpolationkriging

Problems with kriging function in R


I have a dataframe named as kef, consisted of 512 rows, and the fields x, y (referring to coordinates) and v (refering to a certain numeric value for each cell).

I also have a map layer named as grecia.map, loaded in R through the readOGR command consisted of a polygon which represents a certain area.

While running the following command:

kriged <- kriging(kef$x, kef$y, kef$v, polygons = grecia.map, pixels=30000)

I receive the following error messages:

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  0 (non-NA) cases
In addition: Warning messages:
1: In max(x) : no non-missing arguments to max; returning -Inf
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(y) : no non-missing arguments to max; returning -Inf
4: In min(y) : no non-missing arguments to min; returning Inf

Solution

  • Well, I managed to correct the issue. The problem had to do with the data. the coordinates along with the sample values were messed and apparently there was not any spatial logic with the data.

    After importing a correct dataset the function worked properly so I guess that this question could be deleted.

    Thank you