Open In App

How to find out which package version is loaded in R

Last Updated : 30 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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: 

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 :

Output

 

Find out which package version is installed

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

R




packageVersion("dplyr")


Output:

Output

 



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads