所以我一直在尝试构建和加载包,并且一直在收到此错误
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
旁边的评论,但我没有任何。