title: Order list by month and hour in R
body: <p>I have a list of file names I want to read into R. Currently, the file names are in a character vector in alphabetical order so when I use the vector to read in the files, they are arranged in a list in alphabetical order. What I would like is to arrange the character vector according to month and hour (which are contained in the file names in an uncommon format, and there are no date/time variables in the data files themselves). My vector looks something like</p>
  
  <pre><code>chr [1:288] "tair_apr_01.txt" "tair_apr_02.txt" ... "tair_oct_24.txt"
  </code></pre>
  
  <p>That is, there is an element for every hour of every month (the data are averaged across every day, so there are 288 elements in my vector).</p>
  
  <p>Is there a way to reorder my vector so that it's listed by month? i.e.</p>
  
  <pre><code>chr [1:288] "tair_jan_01.txt" ... "tair_dec_24.txt"
  </code></pre>
  
  <p>I know how to sort/order when there are numeric values, and I've seen ways to order by date as long as it's in a certain format. No command I know is able to be applied to this situation, so maybe what I'm really looking for is an efficient way to manually sort the 288 elements. Here's a smaller, complete example:</p>
  
  <p>What I have is </p>
  
  <pre><code>filelist &lt;- c('tair_apr_12.txt', 'tair_dec_24.txt', 'tair_jan_01.txt')
  </code></pre>
  
  <p>and what I want is</p>
  
  <pre><code>filelist &lt;- c('tair_jan_01.txt', 'tair_apr_12.txt', 'tair_dec_24.txt')
  </code></pre>