title: Use sf polygon object as window in spatstat
body: <p>Hello all potential helpers,</p>
  
  <p>I have a <code>SpatialPolygonDataFrame</code> object obtained from the <code>tigris</code> package and I would like to use it as a polygonal window in the creation of a <code>ppp</code> object. Here is what I tried:</p>
  
  <pre><code># Needed packages
  library(spatstat)
  library(sf)
  
  # Download geospatial data for Lee county in Alabama (home of the great Auburn University by the way!)
  county &lt;- tigris::county_subdivisions(state = "Alabama", county = "Lee")
  
  # The polygon of Lee county is subdivided, so I convert it to a single polygon after converting it to an sf object
  county_sf &lt;- st_as_sf(county)
  county_one &lt;- st_union(county_sf)
  
  # A quick plot of the object outputs what I am expecting
  plot(county_one)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TzC4i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TzC4i.png" alt="Lee County, AL"></a></p>
  
  <pre><code># Now I create a planar point pattern and I use county_one as the window
  p &lt;- ppp(x = -85.4, y = 32.5, window = as.owin((county_one)))
  
  # But the plot here shows that the window is just a rectangle and not the polygon :(
  plot(p)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Qjx84.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qjx84.png" alt="ppp object"></a></p>
  
  <p>Thank you for your help.</p>