title: Opening and reading multiple netcdf files with RnetCDF
body: <p>Using R, I am trying to open all the netcdf files I have in a single folder (e.g 20 files)  read a single variable, and create a single data.frame combining the values from all files. I have been using RnetCDF to read netcdf files. For a single file, I read the variable with the following commands:</p>
  
  <pre><code>library('RNetCDF')
  nc = open.nc('file.nc')
  lw = var.get.nc(nc,'LWdown',start=c(414,315,1),count=c(1,1,240))
  </code></pre>
  
  <p>where 414 &amp; 315 are the longitude and latitude of the value I would like to extract and 240 is the number of timesteps.</p>
  
  <p>I have found <a href="https://stackoverflow.com/questions/9564489/opening-all-files-in-a-folder-and-applying-a-function">this</a> thread which explains how to open multiple files. Following it, I have managed to open the files using:</p>
  
  <pre><code> filenames= list.files('/MY_FOLDER/',pattern='*.nc',full.names=TRUE)
   ldf = lapply(filenames,open.nc)
  </code></pre>
  
  <p>but now I'm stuck. I tried </p>
  
  <pre><code>  var1= lapply(ldf, var.get.nc(ldf,'LWdown',start=c(414,315,1),count=c(1,1,240)))
  </code></pre>
  
  <p>but it doesn't work. 
  The added complication is that every nc file has a different number of timestep. So I have 2 questions: </p>
  
  <p>1: How can I open all files, read the variable in each file and combine all values in a single data frame? 
  2: How can I set the last dimension in <code>count</code> to vary for all files?</p>