[Roxygen-devel] How to properly document S4 "[" and “[<-“ method in roxygen?

Mark Heckmann mark.heckmann at gmx.de
Wed Dec 8 13:13:02 CET 2010


Dear roxygen users,

below it posted a mini example in which I want do write documentation for
an “[“ method for a S4 class. Does someone know how to properly document it in roxygen?
I get a warning when checking the package after building (see below).


#' An S4 class that stores a string.
#' @slot a contains a string
#' @export
setClass("testClass", 
		 representation(a="character"))


#' extract method for testClass
#'
#' @docType methods
#' @rdname extract-methods
setMethod("[", signature(x = "testClass", i = "ANY", j="ANY"),
        function (x, i, j, ..., drop){
            print("void function")
        }
)

Excerpt from  package check:
...
* checking for missing documentation entries ... WARNING
Undocumented S4 methods:
  generic '[' and siglist 'testClass'
All user-level objects in a package (including S4 classes and methods)
should have documentation entries.
See the chapter 'Writing R documentation files' in manual 'Writing R
Extensions'.
...

Thanks in advance,
Mark




–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/roxygen-devel/attachments/20101208/9652ddc4/attachment.htm>


More information about the Roxygen-devel mailing list