title: as.Date produces Nan with character vector
body: <p>I am going crazy with the as.Date function in R. I just do not understand why my code does not work.</p>
  <p>Here, you find the data:</p>
  <pre><code>irates_monthly = c(&quot;2000-01&quot;, &quot;2000-02&quot;, &quot;2000-03&quot;, &quot;2000-04&quot;, &quot;2000-05&quot;, &quot;2000-06&quot;, &quot;2000-07&quot;, &quot;2000-08&quot;, &quot;2000-09&quot;, &quot;2000-10&quot;, &quot;2000-11&quot;, &quot;2000-12&quot;, &quot;2001-01&quot;, &quot;2001-02&quot;, &quot;2001-03&quot;, &quot;2001-04&quot;)
  </code></pre>
  <p>which is of type 'character'.</p>
  <p>Now, here is my code:</p>
  <pre><code>as.Date(irates_monthly, format = '%Y-%m')
  </code></pre>
  <p>The only thing I want, is to transform the character vector 'irates_monthly' into a Date object such that I can use it in the xts() function with the argument 'order.by'.</p>
  <p>I am sure this is very simple but I just do not see the mistake. Any help is very much appreciated!
  Also searching through stackoverflow did not resolve my problem!</p>
  <p>I am very thankful for any hints, or solutions!</p>
  <p>All the best,</p>
  <p>Manuel</p>