R文档中这个roxygen的错误在哪里

时间:2015-05-24 12:05:50

标签: r roxygen2 roxygen

我正在使用roxygen生成R文档,除非添加此示例

,否则一切正常
@example dIconTr(c(c(1:2), NA)) and the answe is TRUE, dIconTr(c(1:2)) and the answer is FALSE

,错误信息为:

cannot open file '/Users/myname/Documents/work/Development_Package/mypackage/dIconTr(c(c(1:2), NA)) and the answe is TRUE, dIconTr(c(1:2)) and the answer is FALSE': No such file or directory
Execution halted

Exited with status 1

当我删除该条目the example条目时,一切正常,我可以构建软件包并将其提交给git存储库并发布它

请你帮忙吗?

更新1: 在第一个答案之后,我将我的例子改为:

#' @example doesItContainNullValues(c(1:2))
#' doesItContainNullValues(c(c(1:3), NA))

我没有在R studio中收到错误,但是当我提交给git reposotry时,所有函数的所有文档都被破坏了,现在我收到了这个错误

Error in fetch(key) : lazy-load database 'C:/Users/myname/Documents/R/win-library/3.1/mypackage/help/mypackage.rdb' is corrupt

1 个答案:

答案 0 :(得分:0)

在@example或@examples之后,您必须放置可执行的R代码。

尝试

#' @example dIconTr(c(c(1:2), NA)) # and the answer is TRUE 
#' dIconTr(c(1:2)) #and the answer is FALSE