Roxygen 无法打开文件/权限被拒绝/执行停止

标签 r devtools r-package roxygen

所以我一直在尝试构建和加载包并收到此错误

devtools::document(roclets=c('rd', 'collate', 'namespace'))

Updating stat290.ass2 documentation
Loading stat290.ass2
Error in file(con, "r") : cannot open the connection
Calls: suppressPackageStartupMessages ... topic_add_examples -> read_lines -> <Anonymous> -> file
In addition: Warning message:
In file(con, "r") :
  cannot open file 'C:\Users\blah\Desktop\stat290.ass2': Permission denied
Execution halted

Exited with status 1.

我看过这些帖子作为引用:Roxygen Warning "cannot open the connection" "Permission Denied" , https://github.com/klutometis/roxygen/issues/766 ,但他们说错误已被修复。我尝试删除并重新安装 devtools 和 roxygen2,但没有任何运气

最佳答案

我通过删除函数标题的 roxygen2 注释中的 @return@example 解决了这个问题,因为我没有为它们编写任何内容。看起来,如果你输入一个@XXX,你需要填写它旁边的信息,否则该键缺少值并且会爆炸。

我从错误 topic_add_examples -> read_lines -> 中得到了想法,因为它似乎试图读取我的 @example 旁边的注释,但我没有有的都有。

关于Roxygen 无法打开文件/权限被拒绝/执行停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54541461/

相关文章:

r - 从元素列表到化学式

r - Conda:从github安装R包

r - 自己写的R包找不到自己的函数

r - "for"循环只添加最后的 ggplot 层

r - 如何提取具有正值和负值的相同行

具有私有(private) github 依赖项的 R 包

linux - 如何在 docker 容器中生成与主机用户具有相同所有者的文件

r - 记录 ggplot2 统计扩展 - devtools::document() 未创建 packagename-ggproto.Rd

R CMD 检查 - 包可以安装但不能加载

将 R 中长破折号的所有实例替换为常规减号