My package doesn't work for R 2.15.2
Asked Answered
r
D

3

3

I have a package called rpackage on a local (corporate) repo. When I run install.packages("rpackage") it tells me that:

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

I have built this package using R CMD INSTALL --build . , released to the local repo and also ran tools::write_PACKAGES() to update the PACKAGES files. When I run R --version I get:

R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-w64-mingw32/i386 (32-bit)

And when I run R CMD INSTALL --build --version I get:

R add-on package installer: 2.15.2 (r61015)

The local repo directory structure follows the official documentation and has been working until I updated to R 2.15.2. The structure is:

\\server\folder\R\bin\windows\contrib\
    2.11\
    2.12\
    2.13\
    2.14\
    2.15\
\\server\folder\R\src\contrib\

If I run install.packages("rpackage") in R 2.15.1 I have no problems. Is there something special I need to do to get it to work with the new version of R?

I noticed the CRAN servers use a slightly different directory structure. For example, the CSIRO CRAN mirror uses:

http://cran.csiro.au/bin/windows/contrib/r-release/

Any idea about how to fix this?

Many thanks.

Doorknob answered 30/10, 2012 at 3:12 Comment(8)
Have you set up the local repository to work with R 2.15.2 setting the appropriate option for repos? install.packages gets the repos from getOption('repos')Faizabad
Here's what I get getOptions('repos') for local repo entry: file:////server/folder/rDoorknob
As I mentioned in my post, no I don't get the error in 2.15.1Doorknob
I meant is the repos option the same.Faizabad
Sorry yes. The same for both. Both use the repo settings in .Rprofile as per Hadley's README at github/devtoolsDoorknob
I set up a totally new repo on my local drive. Added it to .Rprofile and released a clean bare bones package (using package.skeleton plus a daft function) and have same issue. I'm filing a bug report.Doorknob
The weird thing is that: install.packages("//server/folder/r/bin/windows/contrib/2.15/rpackage.zip", repos=NULL) works fineDoorknob
@imanuelc: having the same problem: #13156926. Did anything come back from r-devel yet (bug report)?Suctorial
D
7

Unfortunately, neither the help files or the error message explained why this error was occurring. As it turns out, install.packages() also fails when the source package is not available, but the binary does. This is not documented behaviour (or more generously - it is not clearly documented):

For binary installs, the function also checks for the availability of a source package on the same repository, and reports if the source package has a later version, or is available but no binary version is. This check can be suppressed by options(install.packages.check.source = "no")

To fix, options(install.packages.check.source = FALSE). This can also be included in your .First function.

Doorknob answered 4/11, 2012 at 22:43 Comment(1)
should the value set really be "no", or is FALSE actually OK?Desertion
P
2

I am not sure if imanuelc's solution will work for everyone, as it did not work for me:

> options(install.packages.check.source = FALSE)
> install.packages("rstudio", lib="C:/Program Files/R/R-2.15.2/library", dep=TRUE)
Warning in install.packages :
package ‘rstudio’ is not available (for R version 2.15.2)

In my case I've seen this error come and go for certain packages such as tm, rjson, etc. I know that there is a version of all of this packages for R 2.15 because most of them actually come with my IDE and I'm just trying to make them install into a particular directory (and I want the install.packages statement there for future coders with different IDE's).

I can't say that I know the root cause, but for me the work around is downloading the binaries directly from a mirror and installing them "manually" in the code.

Porterporterage answered 21/2, 2013 at 16:36 Comment(2)
You have a lot of stuff that isn't really relevant for an answer. Also - is 'rstudio' a package you want to install or did you want to install the RStudio IDE?Schonfeld
I think there is an rstudio package, but it's a weird one -- it comes with RStudio, and I don't know whether it's actually on any repositories or not.Desertion
F
1

Try upgrading R to the new version.

To do that first update sources.list file. You can do this by using following command:

nano /etc/apt/sources.list

add the following line to this file:

deb http://cran.r-project.org/bin/linux/debian/ wheezy-cran3/

Then do:

apt-get update

Remove older version:

apt-get remove r-base-core

Install using the command:

apt-get install r-base r-base-dev
Festal answered 7/11, 2014 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.