Having 10 raster files in one directory and another 10 rasters in another directory and both have the same dimensions.
files1 <- list.files("C:\\2010", "*.envi", full.names = TRUE) s <- stack(files1)
files2 <- list.files("C:\\2012", "*.envi", full.names = TRUE) s1 <- stack(files2)
I would like to filter s based on s1. I want to replace values in all layers in s by NA whenever corresponding layers in s1 have values greater than 0.6(corresponding pixels).