Bug 15092 - Can't install.packages() from local repo in 2.15.2 (no problems for 2.15.1)
Can't install.packages() from local repo in 2.15.2 (no problems for 2.15.1)
Status: CLOSED INVALID
Product: R
Classification: Unclassified
Component: Add-ons
R 2.15.1 patched
ix86 (32-bit) Windows 32-bit
: P5 major
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-31 07:18 UTC by ImanuelC
Modified: 2012-11-04 11:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ImanuelC 2012-10-31 07:18:24 UTC
Hi guys

I've set up a local repo on my local drive (happens to be mapped to L:/). It has the following structure (as per http://cran.r-project.org/doc/manuals/R-admin.html#Setting-up-a-package-repository):

L:/R/bin/windows/contrib/
    2.11/
    2.12/
    2.13/
    2.14/
    2.15/
L:/R/src/contrib

I created a bare bones package (`anRpackage`) using `package.skeleton`. I cleaned it up and added a basic function, checked it and built it from command line using `R CMD INSTALL --build .`. That generates `anRpackage_1.0.zip` with no errors. Note:

```
$ R CMD INSTALL --build --version
R add-on package installer: 2.15.2 (r61015)
```

I have Rtools 2.16 installed (as this is for R >2.15.1 to R 2.16.x). I have also followed the instructions here: 
http://cran.r-project.org/doc/manuals/R-admin.html#The-Windows-toolset

I copy that to L:/R/bin/windows/contrib/2.15 (for example), run `tools::write_PACKAGES()` in that directory. That successfully generates the packages file.  I also run `tools::write_PACKAGES()` in L:/R/src/contrib to generate an empty PACKAGES file.

I have the following in my .Rprofile (among other things):

```
.First <- function () 
{
   options( 
      repos = c(CRAN    = "http://cran.csiro.au/",
                        WBC_BU  = "file:///L:/R/"))
}
```

I run `install.packages("anRpackage") and I get the following error:

```
Installing package(s) into ‘C:/Program Files/R/R-2.15.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘anRpackage’ is not available (for R version 2.15.2)
```

However, if I run `install.packages("L:/R/bin/windows/contrib/2.15/anRpackage_1.0.zip", repos=NULL)`, it installs successfully.

I do not have this problem in R 2.15.1.
Comment 1 ImanuelC 2012-11-01 01:25:54 UTC
NB: If I provide full file path to install.packages and set repos=NULL, and then check the package's DESCRIPTION file in the help, I see this at the bottom:


`Built: R 2.15.2; ; 2012-11-01 00:22:07 UTC; windows`

(when I've built package using 2.15.2 obviously)
Comment 2 Brian Ripley 2012-11-04 11:01:03 UTC
See https://stat.ethz.ch/pipermail/r-devel/2012-November/065155.html

There is a trap for this user error in R 2.15.2 patched, but the correct usage was on the help page.