-1

I have a raster with 2 bands and I want to compute covariance in 3x3 moving window and replace the focal value with vlue of covariance. I am looking into focal function of raster package and also got some hint to use getValuesBlock with for loop. I will really appreciate if somebody point me towards solve this problem.

gis.rajan
  • 517
  • 3
  • 20
  • can you please provide a reproducible example for your code you are trying. It is not possible to help this way – Hardik Gupta Oct 11 '17 at 11:37
  • 1
    @gi.rajan have you looked at `rasterCorrelation` function? – Geo-sp Oct 11 '17 at 17:00
  • nope, I have not seen rasterCorrelation. I will see that. Thanks for pointing me in the right direction. I found a solution from another post- https://stackoverflow.com/questions/30379604/moving-window-regression – gis.rajan Oct 12 '17 at 02:57

1 Answers1

0

I found a solution from another post- http://stackoverflow.com/questions/30379604/moving-window-regressio‌​n

gis.rajan
  • 517
  • 3
  • 20