title: R - find difference between two dates, one with NAs
body: <p>I am trying to use the diff_in_days function as such:</p>
  <pre><code>all$diff_in_days&lt;- difftime(all$Admit_Date_2, all$Discharge_Date_1, units = c(&quot;days&quot;))
  </code></pre>
  <p><code>Admit_Date_2</code> variable has <code>NA</code>'s so when I converted from the xlsx file, it became a character and is in the 5 digit format (i.e. 43052) and <code>Discharge_Date_1</code> is in the Date class. I am getting the following error:</p>
  <blockquote>
  <p>Error in as.POSIXlt.character(x, tz, ...) :<br />
  character string is not in a standard unambiguous format</p>
  </blockquote>
  <p>Would anyone know how to fix this?</p>