Some R
packages (e.g., ggplot2
, dplyr
,devtools
etc.) have alphabetically entitled sections in their help/documentation and a bar of links to those sections (indicated by red arrows in picture below). Other packages (e.g., RcmdrMisc
) don't have.
How can I add these elements to may R
package's help?
I use roxygen2
for documentation.
In the Writing R Extensions file (included with every copy of R from CRAN) is a small section regarding the INDEX file:
1.1.4 The INDEX file
The optional file INDEX contains a line for each sufficiently interesting object in the package, giving its name and a description (functions such as print methods not usually called explicitly might not be included). Normally this file is missing and the corresponding information is automatically generated from the documentation sources (using
tools::Rdindex()
) when installing from source.
When packages have an index file, the HTML code is in the html
folder.
The help index page is automatically generated by R when you install a package. But note that the alphabetical index is only generated when there are more than 100 items on the index page. There is currently no way to change that behavior. I found that in the code for installing packages
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