title: counting occurrences in data.frame in r
body: <p>I have a data frame 200 columns containing 150 genes (rows) in each column.</p>
  
  <p>I want to count the number occurrences for each gene in the whole data frame</p>
  
  <pre><code>mydat &lt;-
  
      V1       V2       V3        V4       V5       V6        V7       V8  
  1   TGFBR2   TGFBR2   TGFBR2    TGFBR2   TGFBR2   TGFBR2    TGFBR2   TGFBR2
  2   MAML2    MAML2    MAML2     MAML2    MAML2    MAML2     MAML2    MAML2
  3   BMPR2    EIF5A    WRAP53    WRAP53   EIF5A    EIF5A     EIF5A    EIF5A
  4   EIF5A    BMPR2    EIF5A     EIF5A    ADAMTSL3 BMPR2     WRAP53   BMPR2
  5   EIF5AL1  WRAP53   ADAMTSL3  BMPR2    BMPR2    WRAP53    BMPR2    EIF5AL1
  6   WRAP53   EIF5AL1  BMPR2     ADAMTSL3 WRAP53   EIF5AL1   EIF5AL1  WRAP53
  7   TBC1D5   ADAMTSL3 EIF5AL1   EIF5AL1  EIF5AL1  ADAMTSL3  ADAMTSL3 C1QTNF7
  8   ADAMTSL3 C1QTNF7  C1QTNF7   C1QTNF7  FHL1     YAP1      AURKB    ADAMTSL3
  9   C1QTNF7  FHL1     RGS7BP    LIFR     C1QTNF7  TMEM43    C1QTNF7  LIFR
  10  AURKB    RGS5     AURKB     FAM198B  AURKB    C1QTNF7   PSMB6    PDGFD
  </code></pre>
  
  <p>So I want the output to be something like this:</p>
  
  <pre><code>occurences
  TGFBR2: 8
  MALM2 : 8
  FHL1:   3
  </code></pre>
  
  <p>etc. But I want to count every gene in the data frame.</p>
  
  <p>How do I do this?</p>