title: error stacking rasters from list in R on Linux
body: <p>I am having issues stacking my rasters from list before I create raster time series. When I do this directly in the R environment using sample data, it works out fine. 
  The codes prior to this error are:</p>
  
  <pre><code>FunR&lt;-function(r){
    ext&lt;-raster(extent(r),nrow=1100,ncol=1100)
    crs(ext)&lt;-crs(r)
    D&lt;-rasterize(r,ext,field="LFRP")
    EC&lt;-extent(-20, 60,0,30)
    D2&lt;-extend(D,EC)
    D3&lt;-crop(D2,extent(-18,20,2,30))
    s &lt;- raster(nrow=600, ncol=1000,extent(-18,20,2,30))
    crs(s)&lt;-crs(WA)
    Ds &lt;- resample(D3, s, method='bilinear')
    crs(Ds)&lt;-crs(WA)
    Ds
  }
  ###Create rasters and crop
  DL4&lt;-sapply(DL3,FunR)
  DL5&lt;-stack(DL4) #(error occurs after this line)
  </code></pre>
  
  <p>However, once I send it in as a script to run on the HPC I get the following error:</p>
  
  <pre><code>Error in x[[1]] : subscript out of bounds
  Calls: stack -&gt; stack -&gt; .local
  </code></pre>
  
  <p>How do I get ride of this, please? In addition, how do I get rid of files on my list that are totally <code>NA</code>? I suspect this may be an issue too.
  Here's my "qsub" script:</p>
  
  <pre><code>#PBS -o fre8.txt
  #PBS -e fren8.txt
  #PBS -N FRP08_quarterly
  #PBS -q high_mem
  #PBS -l walltime=50:00:00
  #PBS -l nodes=1:ppn=4
  #PBS -l vmem=400gb
  #PBS -m bea
  #PBS -M me@...com
  module load R/3.1.3
  cd /scratch/aroo1
  R --no-save -q -f FRPquarts.R  
  </code></pre>