title: Count multiple columns and group by in R
body: <p>The answers to my last question helped me understand the <code>dplyr</code> <code>n()</code>. But I still couldn't apply to the problem I am trying to solve. So, here I am posting the data and actual problem. The data looks as follows</p>
  
  <pre><code>  finalCalledPartyNumber Call Day           Call Date             Block Answered Call Duration Opty ID Opty Created Date BC ID
               19183598259   Monday 2016-12-05 12:26:46 Block 2(12:30 pm)             1        5    1234              &lt;NA&gt;  &lt;NA&gt;
               17135796188   Monday 2016-12-05 12:18:24 Block 2(12:30 pm)             1       16    &lt;NA&gt;              &lt;NA&gt;  3456
               19183598259   Monday 2016-12-05 15:43:33  Block 4(5:30 pm)             1       10    &lt;NA&gt;              &lt;NA&gt;  4567
               17135796188  Tuesday 2016-12-06 11:53:50 Block 2(12:30 pm)             1       85    &lt;NA&gt;              &lt;NA&gt;  5566
               19014741000  Tuesday 2016-12-06 12:00:11 Block 2(12:30 pm)             1       42    6789              &lt;NA&gt;  &lt;NA&gt;
               19014741000  Tuesday 2016-12-06 10:43:20 Block 2(12:30 pm)             1       58    2345              &lt;NA&gt;  &lt;NA&gt;
    BC Created Date
               &lt;NA&gt;
               &lt;NA&gt;
               &lt;NA&gt;
               &lt;NA&gt;
               &lt;NA&gt;
               &lt;NA&gt;
  </code></pre>
  
  <p>For each <code>finalCalledPartyNumber</code>, I want to count the number of times each <code>finallCalledPartyNumber</code> was called, number of <code>Opty ID</code> and <code>BC ID</code>. The dataset is huge and <code>&lt;NA&gt;</code> just means no <code>Opty ID</code> or <code>BC ID</code> was created. </p>
  
  <p>The Output:</p>
  
  <pre><code>finalCalledPartyNumber    n_opty    n_BC    n_calls
             19183598259         1       1    2
             17135796188         0       2    2
             19014741000         2       0    2
  </code></pre>
  
  <p>I appreciate your help. Thank you.</p>