2

我正在使用 R 版本的 2.15.2 并尝试安装 RODBC 包。但是,我收到一条警告消息“RODBC 不适用于 2.15.2”,它是基于 2.15.3 构建的。我相信我曾经使用过 2.15.2 并且从未遇到过这个问题。任何机构都有同样的问题,你是如何解决的?我不想升级到更高版本

4

1 回答 1

4

Short answer: Download the .tar.gz file then call install.packages on the local file


Longer answer:

  1. Ask google to point you to the archive for the source files for the package of interest. If the package is hosted on CRAN, you will likely find yourself here: http://cran.r-project.org/src/contrib/Archive/RODBC/
  2. Search through the news items to see which is the latest available package version for your version of R. (In this case, 1.3.7)

  3. In R:

    # Where you will save the file, locally        
    localFile <- "~/RODBC.tar.gz"  #or wherever appropriate
    remoteFile <- "http://cran.r-project.org/src/contrib/Archive/RODBC/RODBC_1.3-7.tar.gz"
    
    # download the file
    download.file(remoteFile, localFile)
    
    # Install from local source
    install.packages(localFile, repos=NULL, type="source")
    
    # optionally delete the downloaded file
    unlink(localFile)
    
于 2013-11-12T22:56:30.163 回答