I have some station data and I am trying to regrid the station data into grid data. I have tried the autoKrige
function but an error occurs. I wonder if someone can help me, thanks.
The test data can be downloaded from https://www.dropbox.com/s/68euncqtb3oijw5/testdata.rdata?dl=0
load("testdata.rdata",.GlobalEnv)
library(automap)
library(rgdal)
coordinates(newgrid) <- ~x+y
names(Mydata)[1:2]=c("x","y")
coordinates(Mydata) <- ~x+y
Krig=matrix(nrow = nrow(newgrid@coords),ncol = 30)
for( i in 1:30) {
Krig[,i] = autoKrige(Mydata[,i],input_data=Mydata,new_data = newgrid)$krige_output$var1.pred
}
`Error: too many spatial dimensions: 328`