title: Subsetting data.table set by date range in R
body: <p>I have a large dataset in data.table that I'd like to subset by a date range. My data set looks like this:</p>
  
  <pre><code>testset &lt;- data.table(date=as.Date(c("2013-07-02","2013-08-03","2013-09-04",
                                       "2013-10-05","2013-11-06")), 
                        yr = c(2013,2013,2013,2013,2013), 
                        mo = c(07,08,09,10,11),
                        da = c(02,03,04,05,06), 
                        plant = LETTERS[1:5], 
                        product = as.factor(letters[26:22]), 
                        rating = runif(25))
  </code></pre>
  
  <p>I'd like to be able to choose a date range directly from the <code>as.Date</code> column without using the <code>yr</code>, <code>mo</code>, or <code>da</code> columns. Currently, I'm subsetting by <code>mo</code> and it's extremely clunky at times, especially when years switch over. A more elegant method of doing this would make my life infinitely easier.</p>
  
  <p>Thanks in advance!</p>