【发布时间】:2011-10-15 19:30:54
【问题描述】:
我遇到了这个post 的相反问题。似乎 roxygen 正在将\n 引入我的默认参数值中,这导致 R CMD 检查警告
这是我的函数定义:
WriteToExcel <- function( filePath = stop( "filePath must be specified" ) , worksheet = stop( "worksheet must be specified" ) , toWrite = stop( "toWrite must be specified" ) , rownames = FALSE )
{
...
}
这是警告:
Codoc mismatches from documentation object 'WriteToExcel':
WriteToExcel
Code: function(filePath = stop("filePath must be specified"),
worksheet = stop("worksheet must be specified"),
toWrite = stop("toWrite must be specified"), rownames
= FALSE)
Docs: function(filePath = stop("filePath must be\n specified"),
worksheet = stop("worksheet must be\n specified"),
toWrite = stop("toWrite must be specified"), rownames
= FALSE)
Mismatches in argument default values:
Name: 'filePath' Code: stop("filePath must be specified") Docs: stop("filePath must be\n specif
ied")
Name: 'worksheet' Code: stop("worksheet must be specified") Docs: stop("worksheet must be\n spe
cified")
我错过了什么吗?
【问题讨论】:
-
AFAIK,这是 roxygen2 的一个已知问题。当函数参数被换行以适应给定的宽度时,就会发生这种情况。暂时,我只是忍受警告。
-
啊!很高兴知道这是一个已知问题。我找不到 Roxygen2 的问题跟踪器。有吗?
-
已知问题:github.com/klutometis/roxygen/issues/21,修复在这里:github.com/klutometis/roxygen/pull/26(尚未接受)目前我通常使用肮脏的技巧——将参数留空,并使用@987654327 @
-
太棒了!我将使用 hack =) 关于何时在 CRAN 上接受和更新的任何 ETA?