Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Data Science
  3. Question
Data Science

How to find out which package version is loaded in R?

Asked by Connor Peake Jun 16, 2021 1.5K views 1 answer
Share

About this question

 I am in the process of figuring out how to use my university cluster. It has 2 versions of R installed. System-wide R 2.11 (Debian 6.0) and R 2.14.2 in a non-standard location.

I am trying to use MPI together with snow. The code I am trying to run is the following

library(snow)
library(Rmpi)
cl <- makeMPIcluster(mpi.universe.size()-1)
stopCluster(cl)
mpi.quit()

It works without the problems on R 2.11. (I launch the script with mpirun -H localhost,n1,n2,n3,n4 -n 1 R --slave -f code.R). Now when I try to do it with R 2.14.2, I get the following message:

Error: This is R 2.11.1, package 'snow' needs >= 2.12.1
In addition: Warning message:

So it seems that R loads the package snow version compiled for R 2.11. I've installed snow under R 2.14 into my home folder and I added the following lines to my code:

libPaths("/soft/R/lib/R/library")
.libPaths("~/R/x86_64-pc-linux-gnu-library/2.11")
print(.libPaths())
print(sessionInfo())
print(version)

And the output before the error confirms that I am indeed running R 2.14.2 and my R packages folder is first in the search path. But I still get the error.

 So my question is how to check package version r? I can see with installed.packages all the packages which are installed, so maybe there is some function which lists similar information for loaded packages?


Your answer

1 Answer

More Data Science discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.