Thank you, this works for me. I have a follow-up question. I see some files with GO IDs separated into GO IDs for three categories: CC (cellular component), BP (biological process), and MF (molecular function). If I'm not mistaken, all GO terms fall within these three categories. Is there a way to create three separate dataframes, one containing GO IDs belonging to each of the three categories?
EDIT: I looked into it and if I'm not mistaken, what I'm asking for should conform to the categories in the Ontology column of the GO.db dataframe. So I guess I can just use that.