title: How can I count cells using for loop in r? (table() is not applicable)
body: <p>This is the sample data.</p>
  
  <pre><code>created_date  start_date
  2014-12-11    2014-12-10
  2014-12-11    2014-12-11
  2014-12-12    2014-12-13
  2014-12-13    NULL       
  2014-12-13    2014-12-13
  2014-12-13    2014-12-13
  2014-12-23    NULL
  2014-12-23    NULL
  </code></pre>
  
  <p>I'd like to count how many start_date was checked each day, according to the created_date. The value of start_date is not important, only the 'number' of start_dates checked is meaningful. </p>
  
  <p>In this case, the result of for loop should be like this</p>
  
  <pre><code>created_date  count
  2014-12-11     2 
  2014-12-12     1
  2014-12-13     2
  2014-12-23     0
  </code></pre>
  
  <p>I cannot simply use table() because: </p>
  
  <p>table(created_date) will count created_date, not start_date.</p>
  
  <pre><code>&gt;table(created_date)
  
  created_date  count
  2014-12-11     2 
  2014-12-12     1
  2014-12-13     3
  2014-12-23     2
  </code></pre>
  
  <p>table(start_date) won't work either, since it doesn't count the created date of "NULL" and more importantly, the value of start_date itself is meaningless.</p>
  
  <pre><code>&gt;table(start_date)
  
  created_date  count
  2014-12-10     1 
  2014-12-11     1
  2014-12-13     3
  NULL           3
  </code></pre>
  
  <p>I guess for loop should be used, but don't have idea how to code that.
  Thanks in advance!</p>