title: R total multiple columns at once with n()
body: <p>I don't know if I am missing something very obvious here or not, but I am having trouble getting the desired results format for a count. These are all yes, no or NA answers to a question.</p>
  <p>My data looks a bit like:</p>
  <pre><code>df &lt;- read.table(text = &quot; A  B  C
  0   NA   1
  1   0   NA
  0   1   0
  NA  NA  1
  0   0   1
  1   0   NA
  0   1   NA  &quot;, header = TRUE)
  
  df %&gt;%
  group_by(A, B, C)%&gt;% 
    summarise(count = n())
  </code></pre>
  <p>I have also tried</p>
  <pre><code>count(A, B, C)
  </code></pre>
  <p>with exactly the same results.</p>
  <p>I want to count the total number of 0, 1 and NA responses for each column: (rows and columns are interchangeable here, it's the count of response v column format of the table that I'm after.)</p>
  <pre><code>Response 0 1 NA
  Column A 4 2 1
  Column B 3 2 2
  Column C 1 3 3
  </code></pre>
  <p>What I am getting instead is</p>
  <pre><code>A  B  C  n
  0  0  1  1
  0  1  0  1
  0  1  NA 1
  0  NA 1  1 
  1  0  NA 2
  NA NA 1  1
  </code></pre>
  <p>In other words, it's counting the number of times each unique combination of ABC appears. How do I get it to focus on counting the columns and not the rows?</p>