16.14 Documenting classes, generics, and methods
- S3 generics
- Are regular functions, so document them as such.
dplyr::glimpse()example
- S4 classes and methods
- Use
@slotto document the slots of the class. - Aim to keep all your documentation together
- Use
@rdnameor@describeInto keep docs together - Control ordering of code loading by using
@include
- Use
- RC (reference classes)
- Uses the docstring in the method for the documentation
- Is included within the ‘Methods’ section
- You now only need one
roxygenblock per class - Uses the
@field - See the
accountexample inregexcite
- Uses the docstring in the method for the documentation