pkg_topics() returns a named character vector mapping every alias
(i.e. everything you can type after ?) to the name of the Rd file
(without extension) that documents it. It understands three kinds of
package:
Installed packages, read from their
help/aliases.rdsindex.In-development packages loaded with
pkgload::load_all(), indexed from the\alias{}commands in their sourceman/directory.Source packages, when
packageis a path to a package directory rather than a name.
Indexes remain cached until pkg_cache_reset() is called. Installed package
indexes are also reset automatically when their namespace is unloaded.
For source packages, \alias{} extraction is line-based: any number of
aliases may appear anywhere on a line, but an alias must open and close
on the same line, and aliases produced by Rd macros are not seen.
Examples
head(pkg_topics("stats"))
#> stats-package .checkMFClasses .getXlevels .lm.fit
#> "stats-package" "checkMFClasses" "checkMFClasses" "lmfit"
#> .MFclass .nknots.smspl
#> "checkMFClasses" "smooth.spline"