Counting the number of paralogues for mouse genes gives me the wrong frequency in R
I'd use dplyr for this.

First, mouse paralogues contains no values for mmusculus_paralog_associated_gene_name that are NA:

library(dplyr)
mouse_paralogues %&gt;% 
  filter(is.na(mmusculus_paralog_associated_gene_name)) %&gt;% 
  nrow()

[1] 0


But there are values which are empty strings, so you can filter for those if you wish.

count_mouse_paralogues &lt;- mouse_paralogues %&gt;%
  filter(hsapiens_homolog_associated_gene_name != "") %&gt;%
  count(external_gene_name)


Confirm that this gives the expected result (n = 4) for Plin4:

count_mouse_paralogues %&gt;%
  filter(external_gene_name == "Plin4")

# A tibble: 1 x 2
  hsapiens_homolog_associated_gene_name     n
  &lt;chr&gt;                                 &lt;int&gt;
1 Plin4                                     4


And check mouse_paralogues:

mouse_paralogues %&gt;% 
  filter(hsapiens_homolog_associated_gene_name == "PLIN4")

  hsapiens_homolog_associated_gene_name external_gene_name mmusculus_paralog_associated_gene_name
1                                 PLIN4              Plin4                                  Plin3
2                                 PLIN4              Plin4                                  Plin5
3                                 PLIN4              Plin4                                  Plin2
4                                 PLIN4              Plin4                                  Plin1