Hi! Welcome!
The masking warnings can sound like some sort of intractable conflict
, but that’s not really the case. All it means is that there are packages loaded that have functions with the same names, so R needs more information from you to determine which function you are referring to. This is a normal part of R operations, and not a sign of anything going wrong.
R’s default heuristic is to give priority to the packages that were loaded last, so one approach is to make sure that you always load tidyverse first, then load the more specialized packages you need. An example:
library(tidyverse)
library(genefilter)
Will have the result that when you write code using spec() R will assume you mean spec() from the genefilter package, not spec() from the readr() package.
But what if you want to use both same-named functions in your code? The answer points the way to a less fragile solution than depending on the order of your library() calls. You can always tell R explicitly which functions you mean by including the package name (namespace, in the jargon) using the same syntax you see in the tidyverse masking warning: packageName::functionName(). So genefilter::spec() will give you access to that genefilter function whether or not it’s being temporarily masked by another same-named function in a different package that was loaded later.
In practice, people tend to feel that explicitly including the namespace for all functions makes their code excessively verbose, so typically people will use the tactic only for the doppelgänger function that is rarer in their code, and let the more common one be loaded last and take masking precedence. Up to you!
One more point to remember: it’s convenient to use the tidyverse meta-package to load the default set of tidyverse packages all at once, but as your code matures you may find you aren’t actually using some of them. You can switch to loading just the ones you use individually, which will cut down on name conflicts.
Without knowing what the other error messages were/are, I’m afraid it’s hard to offer much help here. Please do feel welcome to ask about any other issues you’re encountering, but if you do so it’s probably better to start a new forum topic (you can link to this one, if you want, to provide context).