How to find out which package version is loaded in R

The packages in R are defined as the R files which are created and compiled to use. The packages in R are stored in the directory named library so when we install any package we need to load it into our current environment using the library() function. After loading them, we can easily find out which version is being installed.

To find out which package version is loaded, these are the steps :

  1. Installing the packages in R
  2. Loading the package the into current working environment
  3. find out which package version is installed

Let’s start implementing each one step-by-step.

Installing the packages in R

Let’s use the dplyr module in this article. To install that run the code below.

R




install.packages('dplyr')


Output: 

 

We can use any other R module in the same way. Once, installation is done now we need to load the package.

Loading the package into current working environment

For loading the module using the main library, we can use the function(). To load that run the code below.

R




library(dplyr)


Output :

 

Find out which package version is installed

To find the version of package, run the code below.

R




packageVersion("dplyr")


Output:

 



Contact Us