roxygen2でS4クラスのドキュメント化に苦労した後、package.skeleton
,promptClass
、promptMethod
を使用して一歩前進して最小の例を作成することにしました。R CMDチェック中のドキュメントS4クラスと「ドキュメント化されていないコードオブジェクト」
私の問題は、R CMD check
がまだ「文書化されていないコードオブジェクト」について警告を出していることです。私は正しく文書化したと思います。私が今持っている
ファイルは、次のとおりです。
testClass.R:
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)
}
)
TestClassを-class.Rd
\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}
とtestMethod.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 CMD check
ができます:
* 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.
私はこれらのセクションに相談し、私はこれらの中から取ったことは、私はドキュメントの中に入れたalias{testMethod,testClass-method}
になり、この場合generic,signature-list-method
に少なくとも別名が必要だとされています私のpromtMethodの呼び出しによって自動的にファイル(私はそこにコピーされたのでクラスの.Rdファイルからコメントアウトしました)。
この警告を取り除くには、.Rdファイルを変更する必要がありますか?