Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the list of installed packages by user in R

Tags:

r

packages

How we can get the list of installed packages by user in R along with its version?

I know about the command installed.packages() which will give information about all packages (base or non-base). But how we can get those installed by user to have something like this:

Package    Version X          3.01 Y          2.0.1 Z          1.0.2 

For all user installed packages (i.e. those package you installed via install.packages("X"))

like image 255
989 Avatar asked Jul 20 '16 12:07

989


People also ask

How do I list installed packages in R?

To see what packages are installed, use the installed. packages() command. This will return a matrix with a row for each package that has been installed.

How do I see loaded libraries in R?

You can use the packageVersion() function to print version information about the loaded packages. To print the version information about R, the OS and attached or loaded packages, use the sessionInfo() function.

How do I find downloaded packages in R?

R packages are installed in a directory called library. The R function . libPaths() can be used to get the path to the library.

How do you get documentation of an installed and loaded R package?

Besides finding the DESCRIPTION files such as cran.r-project.org or stat.ethz.ch, you can also access the description file inside R with the command packageDescription("package") , via the documentation of the package help(package = "package") , or online in the repository of the package.


2 Answers

ref

ip = as.data.frame(installed.packages()[,c(1,3:4)]) ip = ip[is.na(ip$Priority),1:2,drop=FALSE] ip 
like image 171
Tom Avatar answered Sep 20 '22 17:09

Tom


I just found another ways to see the list of the packages without writing any code:

  • Open RStudio
  • Navigate to Help --> R Help (from the menu above)
  • You will see the help panel opened.
  • Then follow, Reference --> Packages

There you are.


OR

  • Open R console
  • Navigate to Help --> Html help
  • Then follow, Reference --> Packages
like image 20
989 Avatar answered Sep 20 '22 17:09

989