title: Combine separate Year and Month columns into single Date Column
body: <p>I have a data frame (df) like this: </p>
  
  <pre><code>    code     year  month
  1 YYOOGG    2011    8
  2 YYOOGG    2011    1
  3 YYOOGG    2011    4
  4 YYOOGG    2011    3
  5 YYOOGG    2011    12
  6 YYOOGG    2011    9
  </code></pre>
  
  <p>and I need to create a 4th column with the Date like this: </p>
  
  <pre><code>    code     year  month  Date
  1 YYOOGG    2011    8     2011-08
  2 YYOOGG    2014    1     2014-01
  3 YYOOGG    2016    4     2016-04
  4 YYOOGG    2009    3     2009-03
  5 YYOOGG    2000    12    2000-12
  6 YYOOGG    2010    9     2010-09
  </code></pre>
  
  <p>I tried this: </p>
  
  <pre><code>  df$Date &lt;- as.Date(paste(df$year, df$month, sep="-"), "%Y-%M")
  </code></pre>
  
  <p>but I get the following as the date:</p>
  
  <p>2011-09-09</p>