title: Obtaining the subset of points which are outside a specified irregular polygon using {spatstat}
body: <p>I have a large set of points (latitude and longitude) constrained by a complex polygon. However some of the points are not within the bounds of the polygon, and I would like to subset these points from the original data frame (not the ppp object, described below).</p>
  
  <pre><code>#Simple example of a polygon and points.
  ex.poly &lt;- data.frame(x=c(0,5,5,2.5,0), y=c(0,0,5,2.5,5))
  df &lt;- data.frame(x=c(0.5, 2.5, 4.5, 2.5), y=c(4,1,4, 4))
  
  bound &lt;- owin(poly=data.frame(x=ex.poly$x, y=ex.poly$y))
  
  test.ppp &lt;- ppp(x=df$x, y=df$y, window=bound)
  
  #plotting example, to show the one out of the bound owin object
  plot(bound)
  points(df$x, df$y)
  </code></pre>
  
  <p>The error message <code>1 point was rejected as lying outside the specified window</code> comes up, as expected. How would I subset the original dataframe <code>df</code> to find out which point(s) is rejected?</p>