Open alicekcassel opened 4 years ago
This is a common problem with functions that have generic names i.e. select. The first package loaded in takes precedent.
Once you have both packages how do you specify which one to use without unloading the original?
You can directly specify the function and what package it is coming from using a double colon :: , for example:
dplyr::select()
or
AnnotationDbi::select()
If you are unsure of the package name just do ?select. This will show all the packages that you have installed with a function of that name. Another part of doing the :: is that you don't have to use the library() function to load in a package of you use the functions in this way. That said it is better to load in the packages with library() so you have a record of what functions you are using as the packages will be attached, when you look at the sessionInfo().
That helps, thank you!
This is from exercises for session 3. I'm getting an error when I try to use the select function on the OrgDb object before making a PCA plot of the GO heart development genes. Here's the error:
I did some googling and it looks like people who had similar issues solved it by unloading dplyr, but I get another error message when I try to unload dplyr.
Since I had dplyr loaded through tidyverse, I though maybe I needed to load the dplyr library on it's own, so I did that, then tried to unload dplyr and got a different error.
So anyway, I'm just looking for away to run that select function without getting the "UseMethod("select_") error. Thanks so much in advance! Here is the rest of the code from session 3 exercises up to that point.