title: How to extract variable names from a netCDF file in R?
body: <p>I am writing a function in R to extract some air quality modelling data from netCDF files. I have the Package "ncdf" installed.</p>
  
  <p>In order to allow other users or myself to choose what variables to extract from a netCDF file, I would like to extract the names of all variables in the file, so that I can present in a simple list rather than just <code>print.ncdf()</code> the file to give too much information. Is there any way of doing it?</p>
  
  <p>I tried <code>unlist()</code> to the <code>var</code> field of the ncdf object but it seemed that it returned the contents as well...</p>
  
  <p>I googled and searched stack*<em>overflow</em>* but didn't seem to find an answer, so your help is very much appreciated.</p>
  
  <p>Many thanks in advance.</p>