title: Subsetting data frame by list of dates
body: <p>I have a time series data frame (1 entry per min) which has a date column, and I have made a list of all the unique dates in the column. The purpose of this is so I can perform functions on the data for one day at a time. So I want to have a loop where I take all the rows where the date is equal to the first date on my unique dates list, work with this, output, then same for second unique date, third, fourth etc.</p>
  
  <p>When I use the following code I am getting zero rows returned; days and <code>df$Date</code> both are factors. </p>
  
  <pre><code>df &lt;- read.csv("file1.csv")
  
  days &lt;- as.list(unique(df$Date))
  
  for(i in 1:length(days)){
    df &lt;-df[(df$Date == days[i]),] #Only from this date
  
  # Further work with data here
  
  }
  </code></pre>