title: Extracting points that belong to a certain area of a RasterLayer (raster)
body: <p>As per title.</p>
  
  <p>I have a "classified" <code>RasterLayer</code> object which has (apart from <code>NA</code>s) two fixed values, <code>0</code> and <code>1</code>. It is a kind of logical image.</p>
  
  <p>I also have a data frame of points with their coordinates, in form of a <code>SpatialPointsDataFrame</code>.</p>
  
  <p>How can I extract points belonging to a certain area (<code>0</code> or <code>1</code>)? Been searching into <code>raster-package</code> help but I couldn't find a solution.</p>