title: How can i List all files with .nc (netcdf) in a folder and extract 1 variable out of 10 variable?
body: <p>My task is to get multiple similar <strong>NetCDF</strong> (<code>.nc</code>) files from a folder and stack one <code>a</code> variable out of 10 variables.</p>
  
  <p>I used:</p>
  
  <pre><code>a &lt;- list.files(path=ncpath, pattern = "nc$", full.names = TRUE)
  </code></pre>
  
  <p>This gets me all the files with <code>.nc</code> extenstion.</p>
  
  <p>How to proceed for the second task? </p>
  
  <p>I want this variable <code>a</code> from these number of files in a folder and stack them.</p>