在努力用roxygen2记录S4类之后,我决定退一步,使用
package.skeleton
,
promptClass
和
promptMethod
.
我的问题是
R CMD check
仍然对“未记录的代码对象”发出警告,尽管我认为我已经正确地记录了它们。
我现在拥有的文件是:
setClass("testClass",
slots = c(a = "numeric"),
prototype = prototype( a = 0 ),
validity = function(object) return(TRUE))
setGeneric(name = "testMethod",
def = function(object, ...) standardGeneric("testMethod") )
setMethod(f = "testMethod", signature = "testClass",
definition=function(object, x)
{
cat("testMethod:",x,"\n")
invisible(object)
}
)
\name{testClass-class}
\Rdversion{1.1}
\docType{class}
\alias{testClass-class}
%%\alias{testMethod,testClass-method}
\title{Class \code{"testClass"}}
\description{bla bla}
\section{Objects from the Class}{bla bla}
\section{Slots}{\describe{\item{\code{a}:}{Object of class \code{"numeric"} ~~ }}}
\section{Methods}{\describe{\item{testMethod}{\code{signature(object = "testClass")}: ... }}}
\keyword{classes}
和测试方法。Rd
\name{testMethod-methods}
\docType{methods}
\alias{testMethod-methods}
\alias{testMethod,testClass-method}
\title{ ~~ Methods for Function \code{testMethod} ~~}
\description{blabla}
\section{Methods}{
\describe{\item{\code{signature(object = "testClass")}}{blabla}}}
\keyword{methods}
R命令检查
给予:
* checking for missing documentation entries ... WARNING
Undocumented code objects:
âtestMethodâ
All user-level objects in a package should have documentation entries.
See chapter âWriting R documentation filesâ in the âWriting R
Extensionsâ manual.
我查阅了这些章节,我从中得到的是,我至少需要一个别名来
generic,signature-list-method
alias{testMethod,testClass-method}
通过调用promtMethod,它被自动放置在文档文件中(我已经从class.Rd文件中注释了它,因为它在那里重复了)。
我需要在中更改什么。Rd文件以清除此警告?