【问题标题】:Roxygen2 introduces \n to default parameter value. Causes Codoc mismatchesRoxygen2 将 \n 引入默认参数值。导致 Codoc 不匹配
【发布时间】: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?

标签: r roxygen roxygen2


【解决方案1】:

这似乎是一个已知问题。结束这个问题。

【讨论】:

    猜你喜欢
    • 2018-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-13
    • 2012-03-24
    • 1970-01-01
    • 2020-07-21
    相关资源
    最近更新 更多