title: How to know last time action for every user?
body: <p>I have a data frame of my user logs(my input):</p>
  
  <pre><code>user_id    log_category    client_ts
  
  1 Rob      user            1455035670
  2 Fred     progression     1455035345
  3 Rob      design          1455035547
  4 Rob      design          1455035870
  5 Fred     user            1455035970
  6 Fred     progression     1455035548
  </code></pre>
  
  <p>All I want is: To know the last log <code>client_ts</code> for all user_id (output):</p>
  
  <pre><code>user_id    client_ts
  
  1 Rob      1455035870
  2 Fred     1455035970
  </code></pre>
  
  <p>And then add to my input column names <code>is_leave</code> with factor <code>yes</code> if the last <code>last_log_ts &lt; 1455035950</code> (output):</p>
  
  <pre><code>user_id    log_category    client_ts   last_log_ts   is_leave
  
  1 Rob      user            1455035670  1455035870    yes
  2 Fred     progression     1455035345  1455035970    no
  3 Rob      design          1455035547  1455035870    yes
  4 Rob      design          1455035870  1455035870    yes
  5 Fred     user            1455035970  1455035970    no
  6 Fred     progression     1455035548  1455035970    no
  </code></pre>