title: How to test same user is available in next half hour in r?
body: <p>I have a data frame like below.</p>
  
  <pre><code>df:
  x1       x2     x3       X4
  user1  13:00    12:30    13:30
  user2  13:30    13:00    14:00
  user3  15:00    14:30    15:30
  user1  13:10    12:40    13:40
  </code></pre>
  
  <p>Here X1 is the user, X2 is the actual time, X3 is the less than half hour time than actual time. X4 is the next half an hour time than actual.</p>
  
  <p>Here, we have user1 repeated next half an hour also i have to look based on X3 time column. The X3 time 12:40(i.e, 12:30 &lt; 13:00 &lt; 13:30).So, User1 is available to next an hour also.</p>
  
  <p>I have to test like above.Please,Suggest me ideas.</p>
  
  <pre><code>Expected Output:
  X1           X2
  user1       1
  user2       0
  user3       0
  
  X5 is the new column that will tell user available next half an hour time or not. 1 means available, 0 means not available.
  </code></pre>