title: Using Countif on Dates in R
body: <h2>I have the following table</h2>
  
  <pre><code>**A**  | **B**  | **C** |**D** |
  :----: | :----: | :----:|:----:|
  1/1/17 | 3/1/17 |4/1/17 | H    |
  1/1/17 | 3/1/17 |4/1/17 | H    |
  2/1/17 | 4/1/17 |5/1/17 | V    |
  3/1/17 | 5/1/17 |6/1/17 | V    |
  4/1/17 | 5/1/17 |7/1/17 | H    |
  4/1/17 | 6/1/17 |7/1/17 | H    |
  </code></pre>
  
  <hr>
  
  <p>Looking for the result as in the table below using R code</p>
  
  <pre><code> 1. A column with Unique list of dates from columns A,B &amp; C above
   2. A count of dates &lt;= (less than or equal to) the unique 
      dates column value in each of the columns A,B &amp; C from above table. 
   3. Filtered by column D value of 'H' only 
  </code></pre>
  
  <h2>Result</h2>
  
  <pre><code>**Unique Dates**  | **Count of A**  | **Count of B** |**Count of C** |
      :----:        |     :----:      |     :----:     |     :----:    |
      1/1/17        |       2         |       0        |       0       |
      2/1/17        |       2         |       0        |       0       |
      3/1/17        |       2         |       2        |       0       |
      4/1/17        |       4         |       2        |       2       |
      5/1/17        |       4         |       3        |       2       |
      6/1/17        |       4         |       4        |       2       |
      7/1/17        |       4         |       0        |       4       |
  </code></pre>