2015-05-24 57 views
2

我使用roxygen生成R文件中,一切都加入這個例子錯誤在哪裏這個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存儲庫併發布它

你能幫助這個p請問奧林嗎?

更新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 
+0

缺少S:@例如計劃** S ** – bergant

+0

@bergant [R工作室告訴我,有兩個選擇,要麼'@ example'或'@ examples'。無論如何,我會嘗試並在2分鐘內更新 –

+0

@bergant問題保持不變 –

回答

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 
+0

感謝您的這些新的信息。請問例子和exmaples有什麼區別?在我的情況下,我不應該用exmaples代替示例嗎?因爲我想提供兩個示例 –

+0

我不知道確切的區別,但我總是使用@example並放置兩個或多個示例:) – stochazesthai

+0

我收到一個新錯誤,並且所有函數的所有文檔都損壞了,我更新了新信息的問題,你可以檢查嗎? –