title: Convert SpatialPolygonsDataFrame to projected coordinates using spTransform
body: <p>Im trying to do a point pattern analysis. To do this I have to convert a SpatialPolygonsDataFrame so it contains projected coordinates instead of curved coordinates. However I keep getting the same error: </p>
  
  <p>Error in as.owin.SpatialPolygons(Netherlands_flat) : 
    Only projected coordinates may be converted to spatstat class objects</p>
  
  <p>this is the data I used for a border:</p>
  
  <pre><code>download.file("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip",destfile="ne_10m_admin_1_states_provinces.zip")
  unzip("ne_10m_admin_1_states_provinces.zip",exdir="NaturalEarth")
  border &lt;- shapefile("NaturalEarth/ne_10m_admin_1_states_provinces.shp")
  
  #extract the border of the Netherlands 
  Netherlands &lt;- border[paste(border$iso_a2)=="NL",]
  </code></pre>
  
  <p>Im able to plot the plot the Netherlands with the events.</p>
  
  <pre><code>#Plot 
  plot(babesia$Longitude, babesia$Latitude, pch="+",cex=0.5, xlim=c(3.360782, 7.227095), ylim = c(50.723492, 53.554584))
  plot(Netherlands, add = T)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uGNry.png" rel="nofollow noreferrer">Netherlands with events</a></p>
  
  <p>But upon using the Spatstat package I keep running into this error.</p>
  
  <p>I tried this code to transform the coordinates</p>
  
  <pre><code>coord_netherlands &lt;- coordinates(Netherlands)
  proj4string(Netherlands)
  summary(Netherlands)
  
  Netherlands_flat &lt;- spTransform(coord_netherlands, CRS("+proj=longlat +datum=WGS84 +no_defs"))
  Netherlands &lt;- as.owin(Netherlands_flat)
  </code></pre>
  
  <p>Error in as.owin.SpatialPolygons(Netherlands_flat) : 
    Only projected coordinates may be converted to spatstat class objects</p>
  
  <p>Does anyone know how to solve this? Thank you very much in advance!  </p>