title: Convert four digit year values to class Date
body: <p>I've an integer column in my dataset which has four digit year values, like:</p>
  <pre><code> c(2001, 2002, 2002, 2002, 2003, 2005) 
  </code></pre>
  <p>I try to convert the four digit year to class <code>Date</code> using <code>as.Date</code>:</p>
  <pre><code>year &lt;- as.Date(as.character(data_file$evtYear), format = &quot;%Y&quot;)
  </code></pre>
  <p>But the output is:</p>
  <pre><code>&quot;2001-05-15&quot; &quot;2002-05-15&quot; &quot;2002-05-15&quot; &quot;2002-05-15&quot; &quot;2003-05-15&quot; &quot;2005-05-15&quot;
  </code></pre>
  <p>This is giving the wrong output. It's giving two year values in one date (both 2001 and also 15).</p>
  <p>I just want the convert my four digit year part from the original data to 'Year' as class <code>Date</code>. Expected out put is simply:</p>
  <pre><code>2001 2002 2002 2002 2003 2005 
  </code></pre>
  <p>But their class should be of <code>Date</code> type.</p>
  <p>How to achieve this in R?</p>