<div dir="ltr"><div><div><div><div><div><div><div>Hadley,<br><br>Thanks for the quick reply. I'm afraid I'm still a bit over my head on this one. <br><br></div>Since concatenate ("c") is neither a complex method nor my own generic, I gather I need your middle option.<br>
<br><br></div>If I just do: <br><br> #' @rdname c-codeDefinition<br> setMethod("c", signature("codeDefinition"), function(x, ...) new("ListOfcodeDefinition", list(x, ...)))<br><br>
</div>Then check complains about missing \name and \title for the method. <br><br></div>If I add a name and title: <br><br>#' concatenate<br>#' <br>#' concatenate<br>#' @rdname c-codeDefinition<br>setMethod("c", signature("codeDefinition"), function(x, ...) new("ListOfcodeDefinition", list(x, ...)))<br>
<br><br></div>Check complains <br><br>* checking for code/documentation mismatches ... WARNING<br>Codoc mismatches from documentation object 'c,codeDefinition-method':<br>\S4method{c}{codeDefinition}<br> Code: function(x, ..., recursive = FALSE)<br>
Docs: function(x, ...)<br> Argument names in code not in docs:<br> recursive<br><br><br></div>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:<br>
<br>Error in conformMethod(signature, mnames, fnames, f, fdef, definition) : <br> 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<br>
<br><br></div>completely confused as how to document a concatenate method for S4,<br><br>Carl<br><div><br><div><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Jan 21, 2014 at 12:10 PM, Hadley Wickham <span dir="ltr"><<a href="mailto:h.wickham@gmail.com" target="_blank">h.wickham@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> Um, I'm still unclear on what information I do need to properly document the<br>
> S4 methods. Without adding any roxygen documentation, check is unhappy,<br>
> e.g.<br>
><br>
> Undocumented S4 methods:<br>
> generic 'c' and siglist 'codeDefinition'<br>
><br>
> What should I be doing here?<br>
<br>
</div>Adding some documentation? ;)<br>
<br>
You need to decide how to document the methods. There's basically three options:<br>
<br>
* document methods with generic (only an option if you created the<br>
generic) - @rdname generic<br>
* document methods with class (only an option if you created the<br>
class) @rdname class-classname (I think)<br>
* document method in its own file (only suitable if it's a complex method)<br>
<span class="HOEnZb"><font color="#888888"><br>
Hadley<br>
<br>
--<br>
<a href="http://had.co.nz/" target="_blank">http://had.co.nz/</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Carl Boettiger<br>UC Santa Cruz<br><a href="http://carlboettiger.info/" target="_blank">http://carlboettiger.info/</a><br></div>
</div>