title: Converting Numeric format to YYYY Date in R
body: <p>I have a dataset imported from a CSV file, where the "Year" column starts from 2001 going on until 2013.</p>
  
  <p>The column class however, is 'integer'.</p>
  
  <pre><code>&gt; class(Year)
  [1] "integer"
  </code></pre>
  
  <p>I have looked at various solutions and posts on how to make this change, but the solutions seem to be for some version of <code>YYYY-mm-dd</code>/<code>dd-mm-yyy</code>/<code>mm-dd-yyyy</code> or to convert something like <code>20150521</code> to a date.</p>
  
  <p>These are some of the commands I have tried so far, with no luck.</p>
  
  <pre><code>Year &lt;- as.Date(Year, "%Y")
  Error in charToDate(x) : 
    character string is not in a standard unambiguous format
  
  as.Date(Year)
  Error in as.Date.numeric(Year) : 'origin' must be supplied
  
  as.Date(Year, Year[1])
  Error in as.Date.numeric(origin, ...) : 'origin' must be supplied
  
  as.Date(Year, "2001")
  Error in charToDate(x) : 
    character string is not in a standard unambiguous format
  
  as.Date(Year, 2001)
  Error in as.Date.numeric(origin, ...) : 'origin' must be supplied
  </code></pre>
  
  <p>How can I convert a column in just the YYYY format, to a date?</p>