title: How to Subset xts file with date object?
body: <p>I searched for quite a while on this question, but can't find an answer. The challenge is finding a way to subset an xts file by date with the form:</p>
  
  <pre><code> dat &lt;- xts(1:10, as.Date("2000-01-01")+1:10)
   date.1 &lt;-as.Date("2000-01-05")
   dat.subset &lt;-dat[date.1/]
  </code></pre>
  
  <p>This doesn't work, of course, and neither do variations, such as:</p>
  
  <pre><code>dat.subset &lt;-dat["date.1/"]
  </code></pre>
  
  <p>How can I subset with the date.1 object to produce the equivalent of:</p>
  
  <pre><code>dat.subset &lt;-dat['2000-01-05/']
  </code></pre>