Roxygen2 引入 \n 作为默认参数值。导致Codoc不匹配
我遇到了与此帖子相反的问题。似乎 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")
我在这里遗漏了什么吗?
I'm having the opposite issues of this post. It seems that roxygen is introducing \n
into my default parameter values which causes R CMD check to WARN
Here's my function definition:
WriteToExcel <- function( filePath = stop( "filePath must be specified" ) , worksheet = stop( "worksheet must be specified" ) , toWrite = stop( "toWrite must be specified" ) , rownames = FALSE )
{
...
}
And here's the warning:
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")
Am I missing something here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来这是一个已知问题。结束这个问题。
It seems this is a known issue. Closing out this question.