I have been using the spatialEco
package for determining trend, p-value and tau value (raster.kendal). It was giving p-value upto 0.2 so want to do prewhitnning.
while I use kendall function for prewhitnning It is giving an error for both ASCII and GTIFF format.
(error1). when I select a file instead of stack it is giving another error (error2)
ascidata <- list.files(path = "F:/ShareBoth/../ascii/", full.names = TRUE)
length(ascidata)
asciistack <- stack(ascidata)
prewit <- kendall(asciistack, p.value = TRUE, prewhiten = TRUE)
tifdata <- list.files(path = "F:/ShareBoth/../tif/", full.names = TRUE)
length(tifdata)
tifstack <- stack(tifdata)
prewit <- kendall(tifstack, p.value = TRUE, prewhiten = TRUE)
that gives
error1:Error in y[!is.na(y)] : object of type 'S4' is not subsettable
tifdata <- list.files(path = "F:/ShareBoth/../tif/", full.names = TRUE)
length(tifdata)
tifstack <- stack(tifdata)
prewit <- kendall(tifstack$layer1, p.value = TRUE, prewhiten = TRUE)
it gives second error
error2:Error in model.frame.default(formula = y ~ 1, na.action = function (object, :object is not a matrix