title: R - Summarising factor level count per column
body: <p>I have a dataframe that contains a number columns which are all coded as factor variables.
  Each column is based on Questions with only two choices:
  1=yes and 2=no, or missing.
  Each row would be a participant.</p>
  <p>Here a simplified version:</p>
  <pre><code>Q_1  Q_2  Q_3
    1    1    1
    2    1    1
    1    2    NA
    2    1    2
  </code></pre>
  <p>Ideally, I would like to create an overview dataframe with each question as row and the counts of how often a variable each factor occurred. That would also allow me to use dplyrs mutate function ands calculate the percentages etc.</p>
  <p>I would like a frame with the count data:</p>
  <pre><code>      Yes  No  NA
    Q_1   2   2   0
    Q_2   3   1   0
    Q_3   2   1   1
  </code></pre>
  <p>I initially though of simply using group_by and the count function, however there is no real grouping variable, because the factor levels (which happen to be the same for all columns) would be my grouping variable.</p>