I have seen some discussions in SO and elsewhere regarding how this should be or will be done in future versions of Roxygen2. However, I am stuck. How should I document the general S4 movie, as well as its methods, using Roxygen2? A working example for new generic / methods, as well as an example of extending the base S4 generic value will be incredibly useful. I donβt want to do separate (mostly) redundant documentation for each S4 method of the same generic.
Due dilligence: I found a useful example for the "extract" method. However, in my opinion, it is obsolete and incomplete. It uses the @slot tag in the documentation for a class that is not supported (no longer supported). It shows only an extension of the main S4 method "[", and not a complete Roxygen example, including the S4 generic documentation.
How to properly document S4 "[" and "[<-" methods using roxygen?
If I fully document the new S4 generic file with the header, description @param @return @name @aliases @docType @rdname , and then document the S4 method only with the corresponding @name @aliases @docType @rdname , I get the following R CMD check warning:
* checking for missing documentation entries ... WARNING Undocumented S4 methods: << long list of apparently undocumented methods. Eg generic 'plot' and siglist 'myClass1,ANY' >> All user-level objects in a package (including S4 classes and methods) should have documentation entries.
At first it looked as if none of my S4 methods described in this way with roxygen2 actually worked. However, so far I have noticed that my extensions to the main "show" method do not have a related error, although they have been documented in exactly the same way as the others. The following is an example of the complete roxygen documentation included above one of the show methods that did NOT generate an error with the missing documentation:
So I'm at a loss. As you can see, I have included the convention for aliases for S4 methods described in the S4 documentation section of the R package guide , namely: methods must have an alias with the following name (without a space):
generic,signature_list-method.
Somehow this is not fully understood by the R CMD check .
Finally, after creating the documentation, using:
library("devtools") library("roxygen2") document("mypkgname") check_doc("mypkgname")
and creating the package, I get valid documentation. Any headings from the methodβs special documentation end in the Description field, which is rather awkward. Therefore, roxygen2 has obviously done something with each method documentation and is on the right track. However, this is not enough to avoid a large and alarming warning from
> R CMD check mypkgname
I looked at the Rd files, but I know even less about them to quickly understand what the problem is, and I still want to know the solution of roxygen2 so that I do not have to manipulate the Rd files immediately after each revision of the documentation.
So this is a question with a few questions:
What is the current recommended approach for both S4 documentation and S4 using roxygen2?
Is there a good example somewhere that shows complete information?
What could be the reason and solution for warning that documentation for most S4 methods is missing (even if methods with "missing" documentation actually had their document processed by roxygen2, and the resulting Rd files are at least enough to work in the package after R CMD build mypkgname )?