1

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)

  1. ascidata <- list.files(path = "F:/ShareBoth/../ascii/", full.names = TRUE) length(ascidata) asciistack <- stack(ascidata) prewit <- kendall(asciistack, p.value = TRUE, prewhiten = TRUE)

  2. 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

  1. 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

UseR10085
  • 7,120
  • 3
  • 24
  • 54
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Oct 31 '19 at 15:12

0 Answers0