title: Two metric calculation after summarizing
body: <p>In the below data I want to see two metric for each week:</p>
  <ol>
  <li>how many unique household - individual combination are there</li>
  <li>how many unique household - individual combination spent on that week</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/ZM7lr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZM7lr.png" alt="enter image description here" /></a></p>
  <p>For week 1 there are 4 unique household - individual  combination of whom 3 had spent and in week 2, 3 unique combination of whom 2 were spent</p>
  <pre><code>week total present
   1     4       3
   2     3       2
  </code></pre>
  <p>Below is what I did but not sure how to add the 2nd calculation here</p>
  <pre class="lang-r prettyprint-override"><code>data %&gt;%
    group_by(week) %&gt;%
    summarise(total = n_distinct(household, individual)) 
  </code></pre>
  <p>Here is the Sample dataset:</p>
  <pre class="lang-r prettyprint-override"><code>library(dplyr)   
  
  data &lt;- data.frame(week = c(1,1,1,1,1,2,2,2,2),
                     household = c(1001,1001,1001,1001,1002,1001,1001,1001,1001),
                     individual = c(1,1,2,3,2,1,2,2,3),
                     Spent = c(20,30,90,NA,30,40,50,10,NA))
  </code></pre>