<div dir="ltr"><div><div><div>Hi Hadley,<br><br></div>That's great news!  <br><br></div>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.<br>
<br>    Undocumented S4 methods:<br>      generic 'c' and siglist 'codeDefinition'<br><br></div>What should I be doing here?  <br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Jan 21, 2014 at 4:54 AM, 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">
Hi Carl,<br>
<br>
That advice is totally out of date. You shouldn't need to do anything<br>
special for S4 methods.<br>
<br>
Hadley<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jan 20, 2014 at 11:03 PM, Carl Boettiger <<a href="mailto:cboettig@gmail.com">cboettig@gmail.com</a>> wrote:<br>
> Hi roxygen-list,<br>
><br>
> I'm having difficulty implementing S4 roxygen documentation.  I have no idea<br>
> what the correct way to go about this is, so I am mostly extrapolating from<br>
> this [stackoverflow<br>
> answer](<a href="http://stackoverflow.com/questions/7356120/how-to-properly-document-s4-methods-using-roxygen2" target="_blank">http://stackoverflow.com/questions/7356120/how-to-properly-document-s4-methods-using-roxygen2</a>)<br>

> (Happy to get any pointers to other tutorials on the S4 roxygen too).  I'm<br>
> currently stuck trying to document a "concatenate" method:<br>
><br>
> The method looks like this: (See the [full<br>
> package](<a href="https://github.com/ropensci/EML/tree/7d0f006cdcae2f89e667b2c4163083da52e6e147" target="_blank">https://github.com/ropensci/EML/tree/7d0f006cdcae2f89e667b2c4163083da52e6e147</a>))<br>
><br>
>     #' @rdname c-methods<br>
>     #' @aliases c,attribute,ANY-method<br>
>     setMethod("c", signature("attribute"), function(x, ...)<br>
> new("ListOfattribute", list(x, ...)))<br>
><br>
> With which `devtools::document(".")` works just fine, but then `check(".")`<br>
> complains:<br>
><br>
>     Error : /tmp/Rtmpu87hGh/Rbuild785f32a6d07b/EML/man/c-methods.Rd:<br>
> Sections \title, and \name must exist and be unique in Rd files<br>
> ERROR: installing Rd objects failed for package 'EML'<br>
><br>
><br>
> Not sure why check should fail when document works, or what fields I need to<br>
> add.<br>
><br>
><br>
> As a side note, I find the roxygen documentation in the example above to be<br>
> uninformative to a human (i.e. not really in the spirit of literate<br>
> documentation), and rather tedious to enter when I have dozens of such<br>
> concatenate methods, etc.  Without appreciating the details, it seems to me<br>
> that ideally some of this could be generated programmatically from the<br>
> method definition instead?<br>
><br>
><br>
> Thanks for any hints or suggestions.<br>
><br>
> Cheers,<br>
><br>
> Carl<br>
><br>
><br>
> On Fri, Nov 15, 2013 at 5:57 AM, Hadley Wickham <<a href="mailto:h.wickham@gmail.com">h.wickham@gmail.com</a>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> This is just a quick note to let you know that I'm moving towards a<br>
>> new release of roxygen2, bringing in the most important new features<br>
>> and bug fixes from roxygen3. The most important new features are:<br>
>><br>
>> * S4 support (generics, methods and classes), generating correct<br>
>> aliases and usage statements<br>
>><br>
>> * Better S3 support, so that you can just do `@export`, not<br>
>> `@S3method` or `@export` + `@method` depending on whether you're<br>
>> documenting the function or just exporting the definition<br>
>><br>
>> * I've also fixed a number of bugs to do with namespaces, usages and<br>
>> escaping, so generally the set of situations where you need to<br>
>> manually specify usage should be much much smaller.<br>
>><br>
>> * I'm moving towards a system where you can turn off wrapping<br>
>> (<a href="https://github.com/klutometis/roxygen/pull/142" target="_blank">https://github.com/klutometis/roxygen/pull/142</a>) - this will be opt-in<br>
>> in the current version of roxygen, but will eventually become the<br>
>> default. It's just too hard to get wrapping right automatically, and<br>
>> it causes a lot of problems for new users.<br>
>><br>
>> You can see a complete list of changes at<br>
>> <a href="https://github.com/klutometis/roxygen/blob/master/NEWS" target="_blank">https://github.com/klutometis/roxygen/blob/master/NEWS</a>.<br>
>><br>
>> If you are using roxygen for S4 currently, I'd really appreciate it if<br>
>> you'd try it out - you should now be able to remove any custom @alias<br>
>> and @usage tags.  You can try out the dev version with:<br>
>><br>
>> install.packages("devtools")<br>
>> devtools::install_github("devtools")<br>
>> devtools::install_github("roxygen", "klutometis")<br>
>><br>
>> You'll also need a development environment since roxygen2 now includes<br>
>> a little C++ code for better escaping (and will probably include more<br>
>> over time as identify performance benchmarks and move them to C++).<br>
>><br>
>> If you discover any bugs, please file at<br>
>> <a href="https://github.com/klutometis/roxygen/issues" target="_blank">https://github.com/klutometis/roxygen/issues</a>. I'll also consider small<br>
>> new features, but while roxygen2 is now in much better shape than it<br>
>> was a couple of weeks ago, it's still not easy to add new features.<br>
>><br>
>> Hadley<br>
>><br>
>> --<br>
>> Chief Scientist, RStudio<br>
>> <a href="http://had.co.nz/" target="_blank">http://had.co.nz/</a><br>
>> _______________________________________________<br>
>> Roxygen-devel mailing list<br>
>> <a href="mailto:Roxygen-devel@lists.r-forge.r-project.org">Roxygen-devel@lists.r-forge.r-project.org</a><br>
>> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Carl Boettiger<br>
> UC Santa Cruz<br>
> <a href="http://carlboettiger.info/" target="_blank">http://carlboettiger.info/</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<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>