I have a raster image with both numerical values and also NA's and would like to use it as a mask to remove values in a different raster. Does the raster package allow for this?
Example:
Raster A originally had values ranging from 0-1. I applied a raster calculation so that if values are <0.6, then they are transformed to NA. The resulting raster is a mix of values from 0.6 to 1 and NA's. I want to use Raster A to "mask" values from Raster B (Raster B values range from 0 to 1 also) so that if the value in Raster A = NA, then the same cell in Raster B = NA and if the cell in Raster A has a value of 0.6 to 1, then keep the corresponding cell value in Raster B. Any ideas?

