Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I revert to an earlier version of a package?

Tags:

r

I'm trying to write some SPARQL queries in R using the rrdf package. However, I get this error every time I try to load the library.

Error: package 'rrdflibs' 1.1.2 was found, but == 1.1.0 is required by 'rrdf'

Not sure why they didn't write it as >= 1.1.0. Is what they did a good programming practice?

like image 782
Maiasaura Avatar asked Jun 29 '11 00:06

Maiasaura


People also ask

How do I restore a previous version of a file?

Right-click the file or folder, and then select Restore previous versions. You'll see a list of available previous versions of the file or folder. The list will include files saved on a backup (if you're using Windows Backup to back up your files) as well as restore points, if both types are available.

How do I install an older version of an R package?

Installing an older package from source If you know the URL to the package version you need to install, you can install it from source via install. packages() directed to that URL. If you don't know the URL, you can look for it in the CRAN Package Archive.

How do I download a specific version of a package in R?

To install a specific version of a package, we need to install a package called “remotes” and then load it from the library. Afterwards we can use install_version() by specifying the package name and version needed as shown below.


1 Answers

Go to http://cran.r-project.org/src/contrib/Archive/rrdflibs/ to retrieve an older version. This is a source archive, so you will have to be able to build from source (typically easy on Linux, pretty easy on MacOS, and hard on Windows; you can use the http://win-builder.r-project.org/ service to build a Windows binary if necessary).

Actually, based on a quick look at the package, I think you should be able to install in this case (even on Windows without Rtools) via

download.file("http://cran.r-project.org/src/contrib/Archive/rrdflibs/rrdflibs_1.1.0.tar.gz",
   dest="rrfdlibs_1.1.0.tar.gz")
install.packages("rrfdlibs_1.1.0.tar.gz",repos=NULL,type="source")

because the package doesn't actually contain anything that needs to be compiled.

Don't know about programming practice, you'd have to ask the authors if they had some particular reason to do it that way. (See maintainer("rrdf").) Maybe they knew the versions would not be backward/forward compatible?

like image 71
Ben Bolker Avatar answered Oct 12 '22 12:10

Ben Bolker