所以我一直在尝试构建和加载包并收到此错误
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/