title: Formatting yearmon function of package zoo in r
body: <p>I'm using the yearmon function</p>
  
  <pre><code>library(zoo)
  test&lt;-as.Date(c("2015-12-25","2015-11-01"))
  test&lt;-as.Date(test,"%y-%m-%d")
  test&lt;-as.yearmon(test,"%y-%m")
  test
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>"Dec 2015" "Nov 2015"
  </code></pre>
  
  <p>I would like the output to be 2015 Nov. The reason I want this is because I use this to create a heat plot and Dec 2015 shows up in the sequence before Nov 2015 because the variable gets sorted on D. Image of the problem attached</p>
  
  <p><a href="http://i.stack.imgur.com/wyk3u.png" rel="nofollow">Image of the issue for a larger dataset</a></p>