这个问题在这里已经有了答案:





Installing older version of R package

(8 个回答)


6年前关闭。




There is a bug在当前最新版本的 doRedis (1.1.0) 中,以及 downgrade to version 1.0.5 is recommended .但是,我无法在 Windows XP 上将 1.0.5 软件包安装到 R 3.0.1 中!

我试图按照问题“Installing older version of R package”的答案进行操作:

  • answer of Thomas对我不起作用:
    url <- 'http://cran.r-project.org/src/contrib/Archive/doRedis/doRedis_1.0.5.tar.gz' 
    install.packages(url, contriburl=NULL, type="source") 
    # Warning message: 
    # package ‘http://cran.r-project.org/src/contrib/Archive/doRedis/doRedis_1.0.5.tar.gz’ is not available (for R version 3.0.1) 
    
  • 直接编译( answer of Mark Butler ) - 对我也不起作用,即使在卸载以前安装的版本之后也不行,甚至在安装 devtools 之后也不行。 :
    c:\Program Files\R\R-3.0.1\bin>R CMD INSTALL doRedis_1.0.5.tar.gz 
    * installing to library 'c:/Program Files/R/R-3.0.1/library' 
    * installing *source* package 'doRedis' ... 
    ** package 'doRedis' successfully unpacked and MD5 sums checked 
    ** libs 
    ERROR: compilation failed for package 'doRedis' 
    * removing 'c:/Program Files/R/R-3.0.1/library/doRedis' 
    
  • 我试图获得 old windows binary zip file for R 2.14 . R 安装了该软件包,但在尝试加载它时出现以下错误:
    utils:::menuInstallLocal() 
    # package ‘doRedis’ successfully unpacked and MD5 sums checked 
    require(doRedis) 
    # Loading required package: doRedis 
    # Failed with error:  ‘package ‘doRedis’ was built before R 3.0.0: please re-install it’ 
    
  • I also tried to use function install_url from package devtools as proposed by asieira :

  • > require(devtools) 
    > url <- 'http://cran.r-project.org/src/contrib/Archive/doRedis/doRedis_1.0.5.tar.gz' 
    > install_url(url) 
    Downloading doRedis_1.0.5.tar.gz from http://cran.r-project.org/src/contrib/Archive/doRedis/doRedis_1.0.5.tar.gz 
    Installing package from C:\DOCUME~1\Tomas\LOCALS~1\Temp\RtmpwVmfgt/doRedis_1.0.5.tar.gz 
    Installing doRedis 
    pdflatex not found. Not building PDF vignettes. 
    "C:/PROGRA~1/R/R-30~1.1/bin/i386/R" --vanilla CMD build "C:\Documents and Settings\Tomas\Local  \ 
      Settings\Temp\RtmpwVmfgt\devtoolse4025f918\doRedis" --no-manual --no-resave-data --no-vignettes  
     
    * checking for file 'C:\Documents and Settings\Tomas\Local Settings\Temp\RtmpwVmfgt\devtoolse4025f918\doRedis/DESCRIPTION' ... OK 
    * preparing 'doRedis': 
    * checking DESCRIPTION meta-information ... OK 
    * cleaning src 
    Warning in cleanup_pkg(pkgdir, Log) : 
      unable to run 'make clean' in 'src' 
    * checking for LF line-endings in source and make files 
    * checking for empty or unneeded directories 
    * building 'doRedis_1.0.5.tar.gz' 
     
    "C:/PROGRA~1/R/R-30~1.1/bin/i386/R" --vanilla CMD INSTALL "C:\DOCUME~1\Tomas\LOCALS~1\Temp\RtmpwVmfgt/doRedis_1.0.5.tar.gz"  \ 
      --library="C:/Program Files/R/R-3.0.1/library" --install-tests  
     
    * installing *source* package 'doRedis' ... 
    ** libs 
    ERROR: compilation failed for package 'doRedis' 
    * removing 'C:/Program Files/R/R-3.0.1/library/doRedis' 
    Error: Command failed (1) 
    

    有什么方法可以将旧包安装到 R 3.0.1 中?

    编辑: sessionInfo() 的输出:
    > sessionInfo() 
    R version 3.0.1 (2013-05-16) 
    Platform: i386-w64-mingw32/i386 (32-bit) 
     
    locale: 
    [1] LC_COLLATE=Czech_Czech Republic.1250  LC_CTYPE=Czech_Czech Republic.1250    LC_MONETARY=Czech_Czech Republic.1250 
    [4] LC_NUMERIC=C                          LC_TIME=Czech_Czech Republic.1250     
     
    attached base packages: 
    [1] stats     graphics  grDevices utils     datasets  methods   base      
     
    other attached packages: 
    [1] devtools_1.4.1 
     
    loaded via a namespace (and not attached): 
    [1] digest_0.6.4   evaluate_0.5.1 httr_0.3       memoise_0.1    parallel_3.0.1 RCurl_1.95-4.1 stringr_0.6.2  tools_3.0.1    
    [9] whisker_0.3-2 
    

    请您参考如下方法:

    您需要安装 Rtools如果你想在 Windows 上从源代码构建包。您收到的错误消息表示编译失败 - 如果您没有 Rtools,这是有道理的,因为您没有必要的工具来编译源代码。


    评论关闭
    IT干货网

    微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!