title: R: RasterToPolygon works slow, then stop working
body: <p>I have a problem to process rasters in R, even if I've done it previously. I can read the data and plot them:</p>
  
  <p><a href="https://i.stack.imgur.com/QTFZq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QTFZq.png" alt="enter image description here"></a></p>
  
  <p>however,  when I tried to convert my raster to polygon, the R stops working </p>
  
  <p><a href="https://i.stack.imgur.com/xHEJB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xHEJB.png" alt="enter image description here"></a></p>
  
  <p>I've tried to update packages, re-install R, on OSX, on Windows 7, always with the same result. </p>
  
  <p>Moreover, I've tried to set my projection  to NA, but this neither helped. Did you ever experienced problem like this? Do you have some suggestions how to solve the problem? I highly appreciate any suggestions ! </p>
  
  <p>MY data are here: <a href="https://ulozto.sk/x4pHuyra/data-to-stack-zip" rel="nofollow noreferrer">https://ulozto.sk/x4pHuyra/data-to-stack-zip</a></p>
  
  <p>And my code:</p>
  
  <pre><code>library(sp)
  library(raster)
  library(rgeos)
  library(spatstat)
  library(rgdal)     
  library(maptools)
  require(spdep)
  
  
  # read final GFW raster - in JTSK
  
  gfw_13&lt;-raster("H:/.../gfw_ext_forest_03.tif")
  
  projection(gfw_13)&lt;-NA
  
  # read shp
  manag&lt;-readOGR(dsn = "H:/...",
                  layer = "cleared_management_by_NP")
  projection(manag)&lt;-NA
  
  # convert raster GFW to shp       # !!!!! here it stops to work
  pol.gfw&lt;-rasterToPolygons(gfw_13, dissolve = T)
  </code></pre>