title: Subsetting R dataframe on date range
body: <p>I would like to subset my dataset based on a range. My date column is of type 'Date' and looks like this (monthly):</p>
  
  <pre><code> Date
  1926-07-31
  1926-10-31
  1927-01-31
  1927-04-30
  </code></pre>
  
  <p>From other forum posts (such as this one: <a href="https://stackoverflow.com/questions/22420487/subsetting-data-table-set-by-date-range-in-r">Subsetting data.table set by date range in R</a>) I have gathered a few approaches, none of which worked however:</p>
  
  <pre><code>df1 &lt;- subset(df, Date &gt; 1927-07-31 &amp; Date &lt; 1927-10-31)
  df1&lt;-df[df$Date&gt;="1927-07-31" &amp; df$Date&lt;="1927-10-31"]
  </code></pre>
  
  <p>Is there a simple way of doing this (possibly without a new package)?</p>