【问题标题】:R devtools::release() Error in file(con, "r") : cannot open the connectionR devtools::release() 文件中的错误(con,“r”):无法打开连接
【发布时间】:2019-02-19 05:33:56
【问题描述】:

使用 devtools::release() 发布包 我对使用 devtools::check() 确保包正确构建的部分有疑问。

使用托管在https://github.com/RobWHickman/ggparliament 的 gihtub 上的包代码。在各种 Windows 机器上都有同样的错误。还没有机会在 linux 上进行检查。

我在通过 devtools::release 的拼写检查部分后得到的错误是(包名称是 ggparliament,路径本身已经在这里编辑但正确):

Is documentation free of spelling errors? (you can ignore false positives)
1: Yes
2: No way
3: Nope

Selection: 1
Building and checking ggparliament ==================================================================================================

Updating ggparliament documentation

Loading ggparliament

Error in file(con, "r") : cannot open the connection

In addition: Warning messages:

1: In normalizePath(path.expand(path), winslash, mustWork) :
  path[11]="C:\Users\my\path\ggparliament/R/draw_majoritythreshold.R    ": The filename, directory name, or volume label syntax is incorrect

2: In normalizePath(path.expand(path), winslash, mustWork) :
  path[11]="C:\Users\my\path\ggparliament\R\draw_majoritythreshold.R    ": The filename, directory name, or volume label syntax is incorrect

3: In file(con, "r") :
  cannot open file 'C:\Users\my\path\ggparliament\R': Permission denied

正如我所提到的,当使用 devtools::check() 检查包时,我遇到了同样的错误,但如果我使用 rstudio 快捷键 Ctrl+Shift+E 它会起作用,我相信它会做同样的事情。

非常感谢任何帮助!

【问题讨论】:

  • 是的 github.com/RobWHickman/ggparliament 只是为 CRAN 提交而构建
  • 当您运行 devtools::check()devtools::release() 时,是这样完成的(即没有覆盖参数默认值),还是以类似于 devtools::check("path/to/ggparliament") 的方式完成?
  • 无参数运行。也刚刚检查了devtools::check("C:/full/path/to/package/ggparliament"),它给出了同样的错误
  • full/path/to/package 有空格吗?如果有,可能与this issue filed on GitHub有关
  • 很确定不在我尝试过的任何机器上。当前我打开的是C:\Users\Alaa\Desktop\ggparliament(直接从Windows文件资源管理器复制,因此反斜杠)

标签: r package devtools


【解决方案1】:

当我尝试使用 devtools::check(),1 检查您的包裹时,我遇到了同样的错误。使用debug(devtools::check) 后,我可以确定错误是在check() 调用document() 时出现的,然后又可以确定来自document() 的错误是在调用roxygenise() 时引起的。 roxygen2 中似乎存在一个由 this pull request 修复的错误(您可以查看相关问题 here)。在我安装roxygen2的开发版后通过

devtools::install_github("klutometis/roxygen")

运行devtools::check() 时不再出现该错误;看来文件正在正确进行。然而,一旦它开始创建小插图,我得到了一个不同的错误:

* creating vignettes ... ERROR
Quitting from lines 43-60 (arrange_parliament_8.Rmd) 
Error: processing vignette 'arrange_parliament_8.Rmd' failed with diagnostics:
Evaluation error: argument "x" is missing, with no default.

所以你可能需要检查你的小插曲,尽管这似乎是一个不相关的问题。


1。您的问题说明您无法在 Linux 系统上尝试。我的尝试是在运行 Ubuntu 16.04 的计算机上进行的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多