I am using gstat::krige to interpolate a data set of arund 2700 points. However I get an error message "Error in seq.default(zrng, zrng, length.out = cuts + 2):'from' must be a finite number" and I don't understand what does it means. My confusion is that when I do cross validation in the same data set, it works fine. When I do kriging interpolation in less than 2000 points sampled from the same data set, it works fine. But when I do kriging interpolation in the entire data set, predicted values (var1.pred) and variance (var1.var) results is NA.
I can't localized what throws the error. Below you can see what I did and in the link are my files:https://www.dropbox.com/sh/ff2231r2qobg4ud/AAB8aYHlObhakLKdySvLZFsSa?dl=0. In the same link you will find the output of this.
library(sp) library(gstat) t1 <- read.table("SelecPts.iter.txt") g1 <- read.table("Dh9709.grid.txt") coordinates(t1) <- ~ x+y coordinates(g1) <- ~ x+y gridded(g1) <- T Var <- variogram(dh9709~x+y, t1, alpha=c(45,135)) m <- fit.variogram(Var, vgm("Exp"))
cv1<-krige.cv(dh9709 ~ x+y, t1, model = m, verbose=T))
Kriging with 2700 point doesn't work
kg1<-krige(dh9709 ~ x+y, locations = t1, newdata = g1, model = m))