R CMD check warning: Functions/methods with usage in documentation object … but not in code

前端 未结 2 1263
轮回少年
轮回少年 2021-02-05 06:48

I am writing a package but one persistent R CMD check warning prevents me from finishing the package and posting it to CRAN. I use roxygen2 for inline

2条回答
  •  你的背包
    2021-02-05 07:28

    The \usage section in the Rd file needs to include the following:

    \method{names}{surveydata}(x) <- value
    

    If this is not automatically inserted by the @method line (I presume that will only add \method{names}{surveydata}(x)?) then you need an explicit @usage section that includes the above. Something like

    #' @usage \\method{names}{surveydata}(x) <- value
    

    I would also change the @name and @alias sections to refer to the method explicitly not the generic as that will clash with the Rd file in R::base.

    Essentially, the warning is coming from the fact that your package doesn't contains a function "names<-" yet you are using this in \usage{}.

提交回复
热议问题