[Roxygen-devel] Roxygen2 3.0.0

Carl Boettiger cboettig at gmail.com
Tue Jan 21 21:25:30 CET 2014


Hadley,

Thanks for the quick reply.  I'm afraid I'm still a bit over my head on
this one.

Since concatenate ("c") is neither a complex method nor my own generic, I
gather I need your middle option.


If I just do:

    #' @rdname c-codeDefinition
    setMethod("c", signature("codeDefinition"), function(x, ...)
new("ListOfcodeDefinition", list(x, ...)))

Then check complains about missing \name and \title for the method.

If I add a name and title:

#' concatenate
#'
#' concatenate
#' @rdname c-codeDefinition
setMethod("c", signature("codeDefinition"), function(x, ...)
new("ListOfcodeDefinition", list(x, ...)))


Check complains

* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'c,codeDefinition-method':
\S4method{c}{codeDefinition}
  Code: function(x, ..., recursive = FALSE)
  Docs: function(x, ...)
  Argument names in code not in docs:
    recursive


Which seems to suggest that I should be defining the arguments as
`function(..., recursive = FALSE)`, which does indeed match the
documentation shown by ?c.  However if I do so, check really complains that
this format is incorrect:

Error in conformMethod(signature, mnames, fnames, f, fdef, definition) :
  in method for ‘c’ with signature ‘x="codeDefinition"’: formal arguments
(x = "codeDefinition", ... = "codeDefinition", recursive =
"codeDefinition") omitted in the method definition cannot be in the
signature


completely confused as how to document a concatenate method for S4,

Carl




On Tue, Jan 21, 2014 at 12:10 PM, Hadley Wickham <h.wickham at gmail.com>wrote:

> > Um, I'm still unclear on what information I do need to properly document
> the
> > S4 methods.  Without adding any roxygen documentation, check is unhappy,
> > e.g.
> >
> >     Undocumented S4 methods:
> >       generic 'c' and siglist 'codeDefinition'
> >
> > What should I be doing here?
>
> Adding some documentation? ;)
>
> You need to decide how to document the methods. There's basically three
> options:
>
> * document methods with generic (only an option if you created the
> generic) - @rdname generic
> * document methods with class (only an option if you created the
> class) @rdname class-classname (I think)
> * document method in its own file (only suitable if it's a complex method)
>
> Hadley
>
> --
> http://had.co.nz/
>



-- 
Carl Boettiger
UC Santa Cruz
http://carlboettiger.info/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/roxygen-devel/attachments/20140121/1a3fa33b/attachment-0001.html>


More information about the Roxygen-devel mailing list