title: Grouping by sequence and then finding minimum value in a column
body: <p>I have a data set that amoungst other columns has <code>date, sequence and low</code> columns, please see <code>df</code> below.
  The sequence from <code>1-to-9</code> is considered one block or one full cycle in the <code>sequence</code> column
  The data set has several such complete block/cycles and partially completed ones, <code>eg: 1-to-4</code> </p>
  
  <p>This is what I'm trying to solve:</p>
  
  <ol>
  <li>Remove the partly completed cycles and then group the full cycles (see <code>df1</code>)</li>
  <li>For each block/cycle (i.e. sequence from 1-to-9), I want to find the
  low of the block along with the day the low was happened.</li>
  <li><p>If there are two lows with same value but on different dates, then
  it should only output the latest date (see the 3rd block in output)</p>
  
  <pre><code>library(lubridate)
  library(tidyverse)
  ### Sample data
  df &lt;- data.frame(stringsAsFactors=FALSE,
  date = c("1/01/2019", "2/01/2019", "3/01/2019", "4/01/2019",
  "5/01/2019", "6/01/2019", "7/01/2019", "8/01/2019",
  "9/01/2019", "10/01/2019", "11/01/2019", "12/01/2019", "13/01/2019",
  "14/01/2019", "15/01/2019", "16/01/2019", "17/01/2019", "18/01/2019",
  "19/01/2019", "20/01/2019", "21/01/2019", "22/01/2019",
  "23/01/2019", "24/01/2019", "25/01/2019", "26/01/2019", "27/01/2019",
  "28/01/2019", "29/01/2019", "30/01/2019", "31/01/2019",
  "1/02/2019", "2/02/2019", "3/02/2019", "4/02/2019"),
  sequence = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8,
  9, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 9),
  low = c(96, 81, 43, 18, 43, 65, 48, 90, 69, 50, 41, 73, 1, 1, 7, 49,
  16, 79, 2, 74, 8, 88, 56, 57, 66, 29, 79, 51, 52, 47, 42, 9,
  41, 9, 50)) %&gt;% mutate(date = dmy(date))
  </code></pre>
  
  <h3>Data grouped by cycle/block</h3>
  
  <pre><code>df1 &lt;- data.frame(stringsAsFactors=FALSE,
      date = c("1/01/2019", "2/01/2019", "3/01/2019", "4/01/2019",
               "5/01/2019", "6/01/2019", "7/01/2019", "8/01/2019",
               "9/01/2019", "14/01/2019", "15/01/2019", "16/01/2019", "17/01/2019",
               "18/01/2019", "19/01/2019", "20/01/2019", "21/01/2019", "22/01/2019",
               "27/01/2019", "28/01/2019", "29/01/2019", "30/01/2019",
               "31/01/2019", "1/02/2019", "2/02/2019", "3/02/2019", "4/02/2019"),
  sequence = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3,
               4, 5, 6, 7, 8, 9),
       low = c(96, 81, 43, 18, 43, 65, 48, 90, 69, 1, 7, 49, 16, 79, 2, 74,
               8, 88, 79, 51, 52, 47, 42, 9, 41, 9, 50),
     group = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
               3, 3, 3, 3, 3, 3)) %&gt;% mutate(date = dmy(date))
  </code></pre></li>
  </ol>
  
  <p>Final output I am after</p>
  
  <pre><code>  df_final &lt;- data.frame(stringsAsFactors=FALSE,
           date = c("4/01/2019", "14/01/2019", "3/02/2019"),
            low = c(18, 1, 9)) %&gt;% mutate(date = dmy(date))
  </code></pre>
  
  <p>Any ideas?<br>
  Ps. I ran into some problems formatting this question, hence the untidiness.  </p>