title: If Statement in R involving a date
body: <p>I need to create an additional column in my dataset which displays a '1' if a column (V1) in a given row displays a date before 25.07.17, and a '2' if the same column (V1) displays a date after 25.07.17. </p>
  
  <p>The code below has created a column, 'Dataset' as I wish, but every single row is a '2' - even the rows for which V1 is after 25.07.17. </p>
  
  <pre><code>#add column to identify dataset
  if(CombineddatainprogresscsvClean$V1&lt;25.07.17 10:00){
    CombineddatainprogresscsvClean$Dataset=1
  }else
  {
      CombineddatainprogresscsvClean$Dataset=2
  }
  </code></pre>
  
  <p>Can you please tell me where I am going wrong? Thank you.</p>