3

I am trying to install the latest dplyr (version 0.4.1) . But every attempt of install.packages("dplyr") over several different days result in version 0.2 installed.

> install.packages("dplyr")
Installing package into ‘C:/Users/Ricky/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://mran.revolutionanalytics.com/snapshot/2014-10-01/bin/windows/contrib/3.1/dplyr_0.2.zip'
Content type 'application/zip' length 2235535 bytes (2.1 Mb)
opened URL
downloaded 2.1 Mb

Is there any step I'm missing? Is this peculiar to Revolution Analytics user?

Session info below in case of use.

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_Singapore.1252  LC_CTYPE=English_Singapore.1252    LC_MONETARY=English_Singapore.1252
[4] LC_NUMERIC=C                       LC_TIME=English_Singapore.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.6

loaded via a namespace (and not attached):
[1] tools_3.1.1

Edit: .libPaths() output added

> .libPaths()
[1] "C:/Users/Ricky/Documents/R/win-library/3.1" "C:/Program Files/RRO/R-3.1.2/library" 
Ricky
  • 4,616
  • 6
  • 42
  • 72
  • I don't know what's causing this but I would first upgrade to the latest R version and then try again. – talat Feb 19 '15 at 16:53
  • It would also be nice to see your `.libPaths()`. Maybe you have an old version installed to a different library? If you have the old version installed, you could also try `update.packages()` to see if that gets it. – Gregor Thomas Feb 19 '15 at 17:01
  • @docendodiscimus: didn't think of that as I thought my Revolution version is quite new (8.0), just did and got version 8.0.1, and it improved: dplyr moved from version 0.2 to version 0.3.0.2 . not quite the latest available version though – Ricky Feb 19 '15 at 17:11
  • @Gregor: just edited my question to give `.libPaths()` output. `update.packages()` didn't catch `dplyr` having a newer version. – Ricky Feb 19 '15 at 17:13
  • I use rstudio and I'm not familiar with revolution r. Would it make a difference if you just used the RGui to try to install dplyr? (It may be a silly suggestion since I don't know revolution r..) – talat Feb 19 '15 at 17:53
  • @docendodiscimus: just tried from RGui, same result (v0.3.0.2 installed). – Ricky Feb 20 '15 at 14:24

3 Answers3

7

The issue is that you are using one of the snapshots of MRAN as your repository. These snapshots are put in place to make it easier to ensure reproducibility. this was probably set if you made use of the checkpoint package.

If you don't want this then you need to change your repository to not use the snapshot. For example:

install.packages("dplyr", repos = "http://mran.revolutionanalytics.com")
2

Try downloading the package zip/tarball and installing it locally

install.packages("my_desired_dplyr.zip",repos=NULL)
Konrad
  • 17,740
  • 16
  • 106
  • 167
  • When I did this, I got a message that it was successful, but instead the `dplyr` package (including the earlier version I had) disappeared. I had to reinstall from MRAN, getting the earlier version again. – Ricky Feb 19 '15 at 17:25
  • @Ricky, Did you try installing [dev. version](https://github.com/hadley/dplyr) from GitHub? What do you mean that it disappeared, after the installation from zip `require / library` was returning an error? – Konrad Feb 20 '15 at 07:53
  • haven't tried dev. version, and don't intend to; typically prefer to only have the official release version. by disappear, I mean that after installation, `require` then says that I have no such package - I was able to `require` the version 0.2 installed earlier. – Ricky Feb 20 '15 at 14:27
  • Have re-downloaded the zip from CRAN instead of MRAN, seems to work now. Thanks! – Ricky Feb 20 '15 at 14:48
  • I'm still interested to know any reason why install from CRAN doesn't work, and if there is solution that allows download from CRAN direct. – Ricky Feb 20 '15 at 14:49
  • @Ricky, I'm glad to read that it worked. Fell free to accept the answer. On the matter of installing a specific version you can have a look at [this function](https://gist.github.com/viking/1503736), in practice you should be able to force the installation of the most recent version. I had a look at MRAN and CRAN and expectedly both versions are the same. To be honest I don't know. This is a wild guess but maybe there is a problem with the directory where R saves packages. Just out of curiosity have a look at [this article](http://bit.ly/1AXX8au) and confirm that your lib paths are correct. – Konrad Feb 20 '15 at 15:01
1

The problem is that you are trying to install a binary package that has already been compiled for your platform (in this case, Windows). CRAN generally has the most recent version of a package available for users of the most recent release of R, but it does not guarantee this for users of older versions of R. You can check the CRAN page for dplyr and see that the version available for r-oldrel is 0.2.

enter image description here

You can do one of two things.

  1. You can upgrade to the most recent version of R, in which case you should be able to install dplyr v0.4.1 as a binary.

  2. Or you can try installing dplyr as a source package and compiling it on your machine.

    If you take this route, then you may need additional software on your Windows machine. See the R Installation and Administration Manual.

    Then you can install the source package with this command:

    install.packages("dplyr", type = "source")
    

By the way, the dplyr DESCRIPTION requires only R 3.0.2 or greater, so that is not the problem.

Lincoln Mullen
  • 6,257
  • 4
  • 27
  • 30
  • Thanks. Option 1 didn't work, but option 2, which seems similar to Konrad's answer, did the trick. Not accepting as answer yet since I'm interested to see if there's explanation to why this doesn't work for CRAN, and any solution to directly install from there. – Ricky Feb 20 '15 at 14:50
  • What version of R are you running now? If it is not 3.1.2, then you will only get dplyr 0.2 from CRAN. – Lincoln Mullen Feb 20 '15 at 16:01