I need to match the external gene names of a table I have called (which has 1,000,000 entries) with their respective ensemble gene IDs.
Here's a small subset of
and here's a small subset of
I also included a line to see the number of entries in
external_gene_name which do not have corresponding ensemble names. Here is my code:
merged_df <- merge(df, ensembl_ids, by = "external_gene_name") elements_not_in <- df$external_gene_name[!(df$external_gene_name %in% ensembl_ids$external_gene_name)]
But what's confusing me is that when I add the number of rows in
merged_df with that of
elements_not_in, the total exceeds 1,000,000. Shouldn't the total be 1,000,000? I'm wondering if there's a flaw in my code.