title: Error in as.Date.numeric(value) : 'origin' must be supplied
body: <p>I have a column of dates with some dates missing and having NA instead.
  Dates are in format of Date and expressed as: 2010-09-02</p>
  
  <p><a href="https://i.stack.imgur.com/WrdTX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WrdTX.png" alt="If picture helps"></a></p>
  
  <p>I am trying to convert if the cell has date in it to convert it to 1, and if NA to 0.</p>
  
  <p>So far I have:</p>
  
  <p><code>LoanData$DefaultDate[!is.na(as.Date(LoanData$DefaultDate, origin = "1970-01-01")) == TRUE] &lt;- 1</code></p>
  
  <p>and I keep receiving an error: </p>
  
  <pre><code>Error in as.Date.numeric(value) : 'origin' must be supplied
  </code></pre>
  
  <p>Googled the error, but still did not find any explanation.
  Any ideas?</p>