Did the subdirectory structure of package repositories change as of R 2.15.2?
Asked Answered
I

1

1

Kind of embarrassing / a no-go, but since it hasn't been that long that I've moved from "pure user" to "beginner-developer", I've never actually read the CHANGELOG when a new R version came out - well until today (and I have the feeling I should make this a habbit) ;-)

Yet I'm not sure if the supposed change actually occurred since I couldn't find anything about it at a first glimpse at the CHANGELOG of R R 2.15.2:

Actual question

Is it possible that the (subdirectory) structure of package repositories changed from

./bin/windows/contrib/2.xx/

to

./src/contrib/2.xx/ or even ./src/contrib?

Or at least that the PACKAGES file now needs to live here: ./src/contrib/PACKAGES?

Background info

Up to version 2.15.1, the following path worked to install packages from my local package repository:

path.repos  <- "L:/R/packages"
repos       <- file.path("file://", path.repos)

Function contrib.url would take repos and expand it to the right subdirectory:

> contrib.url(repos)
[1] "file:///L:/R/packages/bin/windows/contrib/2.15"

But when I try to run install.packages(), I get the following error for R 2.15.2:

> install.packages("mypkg", 
+     lib=file.path(R.home(), "library"),
+     repos=repos,
+     type="win.binary"
+ )
Error in read.dcf(file = tmpf) : cannot open the connection
In addition: Warning message:
In read.dcf(file = tmpf) :
  cannot open compressed file 'L:/R/packages/src/contrib/PACKAGES', probable reason 'No such file or directory'
> 

When I do the same with R 2.15.1, everything works smoothly.

Due dilligence

There are some references with respect to repositories in the CHANGELOG, but the only section I found that gives me some evidence that the supposed change occurred is this:

PACKAGE INSTALLATION

For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available.

Just had a look at the official documentation again and got the idea that maybe arg type is not passed along to contrib.url() correctly as it seems to me install.package() is looking at the place for type="source" packages?

Ibsen answered 31/10, 2012 at 11:3 Comment(3)
Possible duplicate #13132611Margretmargreta
@mnel: thanks for the pointer. Good opportunity to update my SO skills ;-) What's the recommended behavior in such a situations? I feel like I've added some more details to the question you linked to, but I see that it's not desirable to have duplicates. Should I weave my question into the other one or do I just wait until mine is closed, but still existent for anyone looking for it?Ibsen
I'll flag to close as a duplicate.Margretmargreta
F
2

This particular bug isn't the same as mine.

This issue relates to checks install.packages() now runs before installing. As Rappster said, it tries to find a source package to compare the binary version with:

For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available.

So a simple way of squashing this message is creating the R/src/contrib directory and running tools::write_PACKAGES() in that directory to create (an empty) PACKAGES file.

And of course, the reason you aren't getting this message in 2.15.1 is that it doesn't do the checking (see R NEWS quote above) that 2.15.2 performs.

I have submitted a bug report of my issues. No news yet. May post it to the R mailing list as well.

Full answered 31/10, 2012 at 21:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.