I have a raster where every cell is a 1. I also have a polygon of buffer areas that fall within the raster. I want to assign all raster cells that intersect the polygon geometrics to NA. But the two files have different extents and origins. I don't see a reason to share code, since I build the raster and polygons based on proprietary data. But I can illustrate it. The black grid represents my current raster, the blue cicle is the polygon:
What function will allow me to reassign the raster value of all cells that intersect the polygon? The raster would become as follows: