S3方法的R-oxygen文档在检查时产生错误

时间:2012-11-23 13:21:47

标签: r roxygen

  

可能重复:
  Roxygen: How to properly document a S3 method of a generic in a different package?

我尝试根据包coda中定义的as.mcmc创建一个方法as.mcmc.mcmcComposite。 这是代码:

#' as.mcmc Extract mcmc object from a result to be used with coda package
#' @title Extract mcmc object from a result to be used with coda package
#' @author Marc Girondot
#' @return A mcmc.list object
#' @param x A result object
#' @description Take a mcmcComposite object and create a mcmc.list object
#' @examples
#' # Try
#’ method as.mcmc mcmcComposite
#' @export


as.mcmc.mcmcComposite <-
function(x) {
    return(x$resultMCMC)
}

效果很好但在检查时产生错误:

* checking Rd \usage sections ... NOTE
S3 methods shown with full name in documentation object 'as.mcmc.mcmcComposite':
  ‘as.mcmc.mcmcComposite’

The \usage entries for S3 methods should use the \method markup and not
their full name.
See the chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.

我不明白如何纠正这样的错误。 感谢您的任何建议

Marc Girondot

0 个答案:

没有答案