I'm maintaining a package that has a number of helper functions documented with .rd files. As they are not exported, they are not easily accessible by users - this is good. However, they still show up in the index of package help files.
Is there a way to have documentation removed from the index so that it does not clutter it, but still accessible via help
?
There's a field in the Rd file you can add called keywords
. Most keywords don't do anything except help you search for functions with one notable exception: internal
. Marking a function with the internal keyword removes it from the index. According to the roxygen2 vignette:
@keywords keyword1 keyword2 ...
to add standardised keywords. Keywords are optional, but if present, must be taken from the predefined list replicated in the keywords vignette. Keywords are not very useful, except for@keywords internal
. Using the internal keyword removes all functions in the associated .Rd file from the documentation index and disables some of their automated tests. A common use case is to both export a function (using@export
) and marking it as internal. That way, advanced users can access a function that new users would be confused about if they were to see it in the index.
Adding @keywords internal
to the roxygen comments will give the desired result.
A little bump for people experiencing @keywords internal
not working;
I made the mistake of mixing up ??PACKAGENAME
and help(package="PACKAGENAME")
. Because of this I was left confused why I still saw the documentation of the internals. ??
loads ALL documentation of your package and is not neccesarily the user help index.
Very basic mistake, but there ya go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With