I have a data column of 200 columns containing 150 genes (rows) in each column.
I want to count the number of occurrences for each gene in the entire data frame
mydat <- 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
So, I want the result to be something like this:
occurences TGFBR2: 8 MALM2 : 8 FHL1: 3
etc .. But I want to count every gene in the data frame.
How to do it?
r dataframe
kimmie
source share