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
@slot
to document the slots of the class. - Aim to keep all your documentation together
- Use
@rdname
or@describeIn
to 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
roxygen
block per class - Uses the
@field
- See the
account
example inregexcite
- Uses the docstring in the method for the documentation