从 R 2.15.2 开始,包存储库的子目录结构是否发生了变化? [英] Did the subdirectory structure of package repositories change as of R 2.15.2?

查看:40
本文介绍了从 R 2.15.2 开始,包存储库的子目录结构是否发生了变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有点尴尬/不可行,但由于我从纯用户"转变为初学者开发者"的时间不久,我从未真正阅读过当新 R 使用时的 CHANGELOG版本出来了 - 直到今天(我觉得我应该把它变成一个习惯);-)

Kind of embarrassing / a no-go, but since it hasn't been that long that I've moved from "pure user" to "beginner-developer", I've never actually read the CHANGELOG when a new R version came out - well until today (and I have the feeling I should make this a habbit) ;-)

然而,我不确定假设的变化是否真的发生了,因为我在第一眼看到 CHANGELOG:

Yet I'm not sure if the supposed change actually occurred since I couldn't find anything about it at a first glimpse at the CHANGELOG of R R 2.15.2:

包仓库的(子目录)结构有没有可能从

Is it possible that the (subdirectory) structure of package repositories changed from

./bin/windows/contrib/2.xx/

./src/contrib/2.xx/ 甚至 ./src/contrib?

或者至少 PACKAGES 文件现在需要在这里:./src/contrib/PACKAGES?

Or at least that the PACKAGES file now needs to live here: ./src/contrib/PACKAGES?

在 2.15.1 版本之前,以下路径可用于从我的本地包存储库安装包:

Up to version 2.15.1, the following path worked to install packages from my local package repository:

path.repos  <- "L:/R/packages"
repos       <- file.path("file://", path.repos)

函数 contrib.url 将使用 repos 并将其扩展到正确的子目录:

Function contrib.url would take repos and expand it to the right subdirectory:

> contrib.url(repos)
[1] "file:///L:/R/packages/bin/windows/contrib/2.15"

但是当我尝试运行 install.packages() 时,我收到 R 2.15.2 的以下错误:

But when I try to run install.packages(), I get the following error for R 2.15.2:

> install.packages("mypkg", 
+     lib=file.path(R.home(), "library"),
+     repos=repos,
+     type="win.binary"
+ )
Error in read.dcf(file = tmpf) : cannot open the connection
In addition: Warning message:
In read.dcf(file = tmpf) :
  cannot open compressed file 'L:/R/packages/src/contrib/PACKAGES', probable reason 'No such file or directory'
> 

当我用 R 2.15.1 做同样的事情时,一切都很顺利.

When I do the same with R 2.15.1, everything works smoothly.

CHANGELOG,但我发现的唯一部分给了我一些证据表明发生了假定的更改:

There are some references with respect to repositories in the CHANGELOG, but the only section I found that gives me some evidence that the supposed change occurred is this:

安装包

对于 Windows 或 Mac OS X 二进制包安装,install.packages() 将检查同一存储库中是否有源包,并报告它是否是更高版本或有源包但没有二进制包可用的.

For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available.

刚刚查看了 官方文档 再次想到可能 arg type 没有像我认为的那样正确传递给 contrib.url() install.package() 正在寻找 type="source" 包的位置?

Just had a look at the official documentation again and got the idea that maybe arg type is not passed along to contrib.url() correctly as it seems to me install.package() is looking at the place for type="source" packages?

推荐答案

这个特定的错误与 我的.

这个问题与检查 install.packages() 现在在安装前运行有关.正如 Rappster 所说,它试图找到一个源包来比较二进制版本:

This issue relates to checks install.packages() now runs before installing. As Rappster said, it tries to find a source package to compare the binary version with:

对于 Windows 或 Mac OS X 二进制包安装,install.packages() 将检查同一存储库中是否有源包,并报告它是否是更高版本或有源包但没有二进制包可用.

For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available.

因此,压缩此消息的简单方法是创建 R/src/contrib 目录并在该目录中运行 tools::write_PACKAGES() 以创建(一个空的) PACKAGES 文件.

So a simple way of squashing this message is creating the R/src/contrib directory and running tools::write_PACKAGES() in that directory to create (an empty) PACKAGES file.

当然,您在 2.15.1 中没有收到此消息的原因是它没有执行 2.15.2 执行的检查(请参阅上面的 R NEWS 引述).

And of course, the reason you aren't getting this message in 2.15.1 is that it doesn't do the checking (see R NEWS quote above) that 2.15.2 performs.

我已提交关于我的问题的错误报告.还没有消息.也可以将其发布到 R 邮件列表.

I have submitted a bug report of my issues. No news yet. May post it to the R mailing list as well.

这篇关于从 R 2.15.2 开始,包存储库的子目录结构是否发生了变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆