Hey everyone, I'm a complete beginner to R. I learned about the installed.packages() function, which shows us all of the base R packages. In the priority column, we can see whether a package is listed as "base" or "recommended", which I understand the meanings of. However, for some of my packages in base R, I see an "NA" in the priority column. What does this mean? I know that in order to get rid of all of the "NA"s I need to add the argument priority = "high" into the installed.packages() function, however, I don't understand why NA was even there in our priority column to begin with. Can someone explain what those "NA"s actually signify? Why weren't they just listed as "base" or "recommended?" Thank you.
NA
means "other", or "unspecified", which all contributed packages have to be, at least on CRAN.
So does that mean that the package with the "NA" priority is only installed but not loaded? At least that's what I assumed, so I tried to load the package with the "NA" priority, and I still did not see its priority change into a "base."
No, priority of a package does not change when you install it or when you load it. This is the rule:
-
"base"
: packages that are included in R itself, 14 packages currently for R 4.3.2. Every R installation has these packages. -
"recommended"
: packages that are usually included in R itself, but if not they can be installed from CRAN, 15 packages currently for R 4.3.2. -
NA
: all other packages.
"recommended"
: packages that are usually included in R itself, but if not they can be installed from CRAN, 15 packages currently for R 4.3.2.
So what do you mean by "usually included?" So when some people download R, they may or may not have the recommended packages? Or are you referring to the fact that some packages may or may not be installed due to the VERSION of R that we're downloading?
"NA
: all other packages."
Since we are looking at the packages that we found using the installed.packages() function, aren't these "NA" packages AT LEAST installed, but maybe not necessarily loaded? What does the NA signify about whether those packages are installed and/or loaded?
Thanks
That's correct. In practice they are almost always included, e.g. the Windows and macOS installers on CRAN have them. The Linux builds we provide at GitHub - rstudio/r-builds: an opinionated environment for compiling R have them. But leaner distributions, e.g. GitHub - r-hub/r-minimal: Minimal Docker images for R do not.
That is also true, although the set of recommended packages does not change often. E.g. the parallel package has not always been a recommended package.
Sure, all packages in the output of installed.packages()
are installed.
In general nothing at all.
Of course if you are looking at installed.packages()
output, those are always installed. But if you are looking at the output of available.packages()
, those might or might not be installed.
Thank you! Makes more sense now!
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.