title: Why do dates at infinity look like NAs but act like dates?
body: <p>I was trying to figure out the best way to deal with Postgresql's ability to represent <code>Infinity</code> and <code>-Infinity</code> in their timestamps when using <code>RPostgreSQL</code> to bring data over into R. Along the way I found some strange behavior when trying to represent infinite dates in R.</p>
  
  <p>I can attempt to create a date at negative and positive infinity in the following manner:</p>
  
  <pre><code>❥ as.Date(-1/0, origin="1970-01-01")
  [1] NA
  ❥ as.Date(1/0, origin="1970-01-01")
  [1] NA
  </code></pre>
  
  <p>They both appear to be NAs. However when comparing them, there seems to be an understanding that one is less than the other.</p>
  
  <pre><code>❥ as.Date(-1/0, origin="1970-01-01") &lt; as.Date(1/0, origin="1970-01-01")
  [1] TRUE
  ❥ as.Date(-1/0, origin="1970-01-01") &gt; as.Date(1/0, origin="1970-01-01")
  [1] FALSE
  ❥ as.Date(1/0, origin="1970-01-01") &gt; as.Date("1970-01-01")
  [1] TRUE
  ❥ as.Date(1/0, origin="1970-01-01") &lt; as.Date("1970-01-01")
  [1] FALSE
  </code></pre>
  
  <p>How does R know the difference, if they both convert to NA?</p>