require: raster package
I am having trouble masking values of one raster using values in another. This is similar to this question:
but it doesn't have the moving window (focal function) as a component of the question. I have two rasters with the same dimension, extent, projection.
Raster "MAT2resampled" is a raster with a wide range of temperature indices Raster "wintPCP" is a second raster with pixel values of 1, O, and NA
The only pixels I want from MAT2resampled are those with the value 1 in wintPCP.
I used this code:
PthreshWint2 <- mask(MAT2resampled, wintPCP)
When I plot PthreshWint2, it doesn't appear as though the MAT2resampled raster has been masked at all. I think I'm missing something simple.
I have posted the two rasters here: https://drive.google.com/open?id=118kCu6QpoXSYmA17PpODRhHDJefHPkx1
https://drive.google.com/open?id=1N062TiHTHBqRYrclRW8O87WY-MX8taQg