Sampling random points in R with both raster and shapefile constraints I am trying to sample random points according to 2 conditions: