Explore Courses Blog Tutorials Interview Questions
0 votes
in R Programming by (7.3k points)
edited by

I am trying to use Rpy2 and ggplot2 but I get an error. After some searching for the error online, I found that the error occurs because there are changes in the ggplot2 package that are not yet reflected in Rpy2.

So I now need to install an older version of ggplot2. Here is pseudo-code for what I want:

install.packages("ggplot2", version='0.9.1')

But install.packages does not have a version argument. How do I do it?

1 Answer

0 votes
edited by

To install an older version of a package from source, do the following:

PackageUrl <- ""

 install.packages(PackageUrl, repos=NULL, type="source")

In some cases, you need to install Rtools so that you can compile the archived packages locally.

You can also use the devtools package to install an older version of a package as follows:


 install_version("ggplot2", version = "0.9.1", repos = "") 

You can also use the remotes package as follows:


install_version("package_name", "0.1.1")

Browse Categories