I have a question concerning the extraction of spatial points that match a certain value of an additional raster in R. The operation itself should actually be pretty simple, but I'm stuck somehow. (I am using R at a "lower intermediate" level).
I am using two data sets. The first one is a shapefile containing point data.
training1 <- shapefile ("re_27042015projcrop_all.shp")
The second one is a "binary mask" raster object consisting solely of 0 and 1 values.
radar1 <- brick ("binary_01_180115_240415.envi")
How do I extract all points whose coordinates match raster pixels with a value of 1?
I tried some logical expressions like
output <- training1@coords & radar1==1
and various raster functions like crop, mask etc., but none seemed to work.