Roxygen2将\ n引入默认参数值。导致Codoc不匹配

时间:2011-10-15 19:30:55

标签: r roxygen roxygen2

我遇到了这个post的相反问题。似乎roxygen正在将\n引入我的默认参数值,导致R CMD检查为WARN

这是我的功能定义:

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")

我在这里错过了什么吗?

1 个答案:

答案 0 :(得分:0)

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