title: as.Date returning NA
body: <p>I have this df</p>
  <pre><code>Date;count
  2014-10-15;1
  2014-12-01;1
  2015-01-14;1
  2015-03-15;1
  2015-07-20;1
  2015-10-15;1
  2016-01-02;1
  2016-01-03;1
  2016-02-15;1
  2016-04-15;1
  </code></pre>
  <p>The Date is in %Y-%m-%d format and I created another column with just month and year using the dplyr package. This new column has the correct data as character,so I added a new command to convert this column:</p>
  <pre><code>df&lt;-df %&gt;%
    mutate(monthyear = format(Date, &quot;%m-%Y&quot;)) %&gt;%
    mutate_at(vars(monthyear), as.Date, format = &quot;%m-%Y&quot;)
  </code></pre>
  <p>It turns out that the output of the monthyear column is NA.
  I tried converting this column to factor before converting to date and NA continues.
  I also tried</p>
  <pre><code>df&lt;-df %&gt;%
    mutate(monthyear = format(Date, &quot;%m-%Y&quot;))
  </code></pre>
  <p>and then run the commands</p>
  <pre><code>df$monthyear &lt;- as.Date(df$monthyear, format = &quot;%m-%Y&quot;)
  </code></pre>
  <p>or</p>
  <pre><code>df$monthyear &lt;- as.Date(paste0(&quot;1/&quot;, df$monthyear), format = &quot;%d/%m/%Y&quot;)
  </code></pre>
  <p>In all cases my output is NA in all rows.</p>