Is there a way to count how many of one value there is in a column (using R)?
I am trying to work out the number of paralogs there are per gene for my biology degree. So far I have a table that looks like this:
Gene name Paralog
14 Crabp2 Crabp1
15 Crabp2 Rbp2
16 Crabp2 Rbp7
17 Crabp2 Rbp1
18 Crabp2 Fabp5
19 Crabp2 Fabp7
20 Crabp2 Pmp2
21 Crabp2 Fabp12
22 Crabp2 Gm37389
23 Crabp2 Fabp3
24 Crabp2 Fabp9
25 Crabp2 Fabp4
26 Zfp653 AC163623.1
27 Zfp653 Zfp276
28 Zfp653 Zfp91
29 Zfp653 Zfp692
30 AC163623.1 Zfp653
31 AC163623.1 Zfp276
32 AC163623.1 Zfp91
33 AC163623.1 Zfp692
34 Apom
35 Map10
As you can see from the table, 'Crabp2' has many paralogs. There are many paralogs to a gene - some genes have none - but I want to find out how many paralogs per gene. I'm trying to get a table that looks something like this:
Gene freq
Crabp2 12
Zfp653 4
AC163623.1 4
Apom 0
Map10 0
The original table consists of 25,000 rows.