14

我正在 Windows 机器上使用 Rtools30 和与 RStudio 关联的“构建”工具在 R 3.0.1 中构建 R 包,我假设这些工具与 devtools 相关联(这是最新的)。我构建包的典型过程是:

  1. 全部加载
  2. 再充氧
  3. 构建和重新加载
  4. 查看
  5. 构建源包

如果一切顺利,没有错误或警告,那么我:

    install.packages("foo.tar.gz", repos=NULL, type="source")

自从升级到 R 3.0.1,我现在收到这个警告:

   Warning in install.packages : 
      foo.tar.gz is not available (for R version 3.0.1)

我在安装前也试过了,它并没有摆脱警告:

    options(install.packages.check.source = FALSE)

另外,当我打开 devtools 库时,我注意到了这个警告:

    WARNING: Rtools 3.0 found on the path at c:/Rtools is not compatible with R 3.0.1.

这很奇怪,Rtools 3.0 应该从 R >2.15.1 到 R 3.0.x 都很好

有什么想法吗?

4

1 回答 1

11

This is RStudio specific, as they wrap and/or changed a lot of functions from the utils for better integration. The problem lies with a call to getDependencies() to check for dependencies. But that function will also check whether the original package exists on CRAN and throws the given warning when it doesn't. A package you just built on your own computer is obviously not on CRAN, hence the warning.

In the source of the native install.packages(), getDependencies() isn't called in case you build from source or install from a different repository respectively. RStudio on the other hand calls getDependencies() before it passes everything on to the native install.packages() function.

This has to my knowledge no further effects, apart from confusing people. I didn't find a way to conveniently get rid of this in RStudio, as suppressWarnings() doesn't work in this context due to the complex way RStudio deals with this.

In a basic R console, you shouldn't have any problem.

So for the time being, I'd just ignore this and hope the RStudio team finds time to take care of this minor glitch.

于 2013-06-11T12:03:37.433 回答