2017-10-11 6 views
0

roxygen2로 S4 클래스를 문서화하는 데 어려움을 겪은 후, package.skeleton, promptClasspromptMethod을 사용하여 한 걸음 뒤로 물러나기로 결정했습니다.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} 

또한 documen 패키지입니다. tation 파일이지만 여기서는 관련이 없다고 생각합니다.

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 파일을 변경해야합니까?

답변

0

한편, 나는 문제를 알아 냈다. .Rd 파일에 \alias{testMethod}라고 묻는 것 또한 필요합니다. 그러나 이상한 것을 발견했습니다. promptMethod에 의해 생성 된 파일에는이 별칭이 포함되지 않았습니다.

관련 문제