I have been playing around with the krigeST
function in the gstat
package, and I tried to do local kriging with a full set of SpatialPolygons based data (STFDF).
When I tried the following
spatio_time_krige_sumProd = krigeST(conso~1,
some_STFDF_with_SpatialPolygons_in_sp,
newdata = some_STF_with_SpatialPolygons_in_sp,
fitted_prodSum_variogram,
nmax = 50,
stAni = 4)
Error in from@sp[from@index[, 1], ] :
SpatialPolygons selection: can't find plot order if polygons are replicated
What seems to be the problem is that in krigeST.local, the some_STFDF_with_SpatialPolygons_in_sp
is coerced into a SFIDF
. In that, there is a subsetting step which is not allowed by the SpatialPolygons
class, since there are repeated terms in from@index[, 1]
.
I'd like to try non-separable spatio-temporal variogram, so not using local kriging isn't really an option. Is there a workaround for this problem?
Thanks.