title: R - how do I declare a vector of Date?
body: <p>For example, I tried the following to create a vector of Dates, length 5. None work:</p>
  
  <pre><code>date(5)
  Date(5)
  vector(5, mode = "Date" )
  </code></pre>
  
  <p>This works, but wondering if there is a shortcut?</p>
  
  <pre><code>as.Date( numeric( 5 ) )
  </code></pre>
  
  <p>Also, I see that mode( as.Date("2011-01-01" ) ) is numeric and I understand that the underlying data structure for dates is numeric, but given that vector() only has a mode and length argument, it seems to me that its impossible to create a vector of Date without coercion?</p>
  
  <p><b>Edit</b><br>This is also a solution, except for length = 0?</p>
  
  <pre><code>Date = function( length = 0 )
  {
     newDate = numeric( length )
     class(newDate) = "Date"
     return(newDate)
  }
  </code></pre>