title: List organization by file name in R
body: <p>I'm trying to create a list of data separated by month and year (40 years worth).  The data currently has the name structure (Year)-(Numeric Month)-(Var).nc. I'd like to get all the data into its appropriate list created below.  Not exactly sure how to proceed from here.  Any guidance is appreciated.</p>
  
  <pre><code>files_nc &lt;- list.files(pattern = ".nc")
  
  year &lt;- vector("list", length = 40) 
  month &lt;- vector("list", length = 12)
  
  names(year) &lt;- c(1978:2017)
  names(month) &lt;- c("Jan","Feb","Mar","Apr","May","Jun","Jul", 
     "Aug","Sep","Oct","Nov","Dec")  
  
  for (i in 1:40) { 
     year[[i]] &lt;- month
  }
  </code></pre>