【问题标题】:@title Missing name in Roxygen@title Roxygen 中缺少名称
【发布时间】:2020-07-01 21:56:07
【问题描述】:

我有 R6Class 的文档:

#' Root component that don't have parent,
#'
#' It should not be used directly, only using \code{\link{pkg::component}} function.
#'
#' @name BaseComponent
#' @importFrom R6 R6Class
#' @docType class

#' @keywords components, architecture, structure

和 roxygen 显示警告:

警告:[c:\projects\pkg\R\components.R:1] @title 缺少名称

我不知道为什么它显示第 1 行,我的代码不在第 1 行。

添加@title 不会改变任何东西我一直收到这个警告。

【问题讨论】:

  • 我也有同样的问题。但是,我在文件末尾没有不寻常的评论,因此提供的答案并没有为我解决这个问题。我有很多文件,都遵循相同的注释模式,并且没有一个会引发这种警告。把我逼疯了……
  • @HolgerBarlt 我不确定我是否跟随,你说过他们不会抛出这个警告。如果您确实有此错误,请检查是否缺少其中一条评论 @title。还要检查您是否没有 R6 类,它们的处理方式不同。如果你仍然有警告,也许你应该问另一个问题,因为这里可能没有人会给你一个,它有答案并且被接受了。

标签: r roxygen


【解决方案1】:

警告令人困惑,文件的最后一行是这样的:

#' init extend on base battery component
BaseComponent$extend <- make.extend(BaseComponent)

## 替换#' 解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-12
    • 1970-01-01
    • 1970-01-01
    • 2015-10-18
    • 1970-01-01
    • 1970-01-01
    • 2021-08-18
    相关资源
    最近更新 更多