title: Counting the number of unique values by date in R
body: <p>Please help me to count the number of unique IDs per Date.
  so, initially, there is this data frame of IDs and dates </p>
  
  <pre><code> ID         Date 
   1        2009/11/1
   1        2009/11/2
   1        2009/11/2
   2        2009/11/1
   2        2009/11/1
   2        2009/11/2 
   3        2009/11/1
   3        2009/11/3  
  </code></pre>
  
  <p>It is possible to rearrange it by date. If we do so then we will see that on the 1st there are 3 unique IDs. On the 2ed 2 unique ID and on the 3rd there is one unique ID. So the final table should look like this: </p>
  
  <pre><code>  Date      uniqueIDs
  2009/11/1      3
  2009/11/2      2
  2009/11/3      1
  </code></pre>
  
  <p>I know that it is possible to aggregate with <code>aggregate</code>  by using <code>sum</code> if the value is '1' or '0 'like that:</p>
  
  <pre><code>aggregate(DataFrame$RoomAv ~ DataFrame$Date, DataFrame, sum)
  </code></pre>
  
  <p>But how to <strong>count</strong> the unique number of IDs per day? The ID column is an integer column.</p>
  
  <p>Thanks a lot!</p>