My package doesn't work for R 2.15.2

前端 未结 3 598
说谎
说谎 2020-12-19 18:14

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

Installin         


        
相关标签:
3条回答
  • 2020-12-19 18:40

    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.

    0 讨论(0)
  • 2020-12-19 18:49

    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
    
    0 讨论(0)
  • 2020-12-19 18:58

    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.

    0 讨论(0)
提交回复
热议问题