title: Parallel processing of big rasters in R (windows)
body: <p>I'm using the doSNOW package and more specifically the parLapply function to perform reclassification (and subsequently other operations) on a list of big raster datasets (OS: Windows x64).</p>
  
  <p>The code looks a little like this minimalistic example:</p>
  
  <pre><code>library(raster)
  library(doSNOW)
  
  #create list containing test rasters
  
  x &lt;- raster(ncol=10980,nrow=10980) 
  x &lt;- setValues(x,1:ncell(x)) 
  
  list.x &lt;- replicate( 9 , x )
  
  #setting up cluster
  
  NumberOfCluster &lt;- 8
  cl &lt;- makeCluster(NumberOfCluster)
  registerDoSNOW(cl)
  junk &lt;- clusterEvalQ(cl,library(raster))
  
  #perform calculations on each raster
  
  list.x &lt;- parLapply(cl,list.x,function(x) calc(x,function(x) { x * 10 }))
  
  #stop cluster
  
  stopCluster(cl)
  </code></pre>
  
  <p>The code actually works as intended. The problem occurs when I want to proceed with the results. I'm receiving this error message:</p>
  
  <pre><code>&gt; plot(list.x[[1]])
  Error in file(fn, "rb") : cannot open the connection
  In addition: Warning message:
  In file(fn, "rb") :
    cannot open file 'C:\Users\*****\AppData\Local\Temp\RtmpyKYdpY\raster\r_tmp_2016-02-29_133158_752_67867.gri': No such file or directory
  </code></pre>
  
  <p>As far as I understood, since the rasters are quite big, they are saved in a temp file on disk. And when I'm closing the snow cluster, these files can't be accessed anymore.</p>
  
  <p>So my question is, how can I access the data once the cluster is closed? Can I proceed using this method? </p>
  
  <p>Thanks! </p>