title: Extract from table in R
body: <p>I have a problem which should be to hard but I can't get it the way i want. My df have about 200 rows and almost 4200 columns. The only thing that exist are 0, 1 and 2 in the df. 
  Something like: </p>
  
  <pre><code>    Col1 Col2 Col3 ...
  Row1  2    1   0
  Row2  1    1   1
  Row3  2    2   2
  .
  .
  </code></pre>
  
  <p>I now want to save how many times number 2 apper in each coloumn so i wrote </p>
  
  <pre><code>freq&lt;-sapply(df,table)
  </code></pre>
  
  <p>but here is where I get stuck. I want to save how many 2:s there was in every coloumn and save it in a ny df and keep track of which coloumn had that many 2:s. </p>
  
  <p>Want it to look something like this (if it was done on the example above):</p>
  
  <pre><code>Col1 Col2 Col3
    2    1    1
  </code></pre>
  
  <p>Sorry that I explaning a bit bad right now. Please tell me if I should add something to make it easier to understad my problem. </p>