title: Dataframe analysis by sample name and date in R
body: <p>I have a dataframe of groundwater sample results. The table could look like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Well Number</th>
  <th>Sampling Date</th>
  <th>Compound</th>
  <th>Result</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>2020-01-01</td>
  <td>a</td>
  <td>0.5</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2020-01-01</td>
  <td>b</td>
  <td>0.3</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2020-01-01</td>
  <td>a</td>
  <td>0.6</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2020-07-01</td>
  <td>c</td>
  <td>0.1</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2020-07-01</td>
  <td>c</td>
  <td>0.1</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2020-07-01</td>
  <td>c</td>
  <td>0.4</td>
  </tr>
  <tr>
  <td>B</td>
  <td>2020-02-01</td>
  <td>a</td>
  <td>0.1</td>
  </tr>
  <tr>
  <td>B</td>
  <td>2020-08-01</td>
  <td>c</td>
  <td>0.1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Now, I would like to analyse the data for each well and each sampling date. Specifically, I would like to determine, whether the wells have at least 2 compounds that have been measured with a result over 0.2 on the same date.</p>
  <p>If yes, I would like to store this information. So, in this example well A has 3 compounds with a value of over 0.2 on 2020-01-01. So the stored information should look something like:</p>
  <p>A 2020-01-01 -&gt; true</p>
  <p>A 2020-07-01 -&gt; false</p>
  <p>B 2020-02-01 -&gt; false</p>
  <p>B 2020-08-01 -&gt; false</p>
  <p>My table has thousnds of rows and non-linear data intervals. So the time and quantity of the measurements vary for each well.</p>
  <p>How can I go through the data and make this anaysis and store it? I tried the split function to split the set into smaller sets by date and well number. But I did not really now how to work with the output format. Also, I remember in python I think I did something similar with a loop function (for i in...). Would that also work in R? And if yes, how?</p>
  <p>Thank you very much even just for reading through my question :)</p>