% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pkg.R
\name{pkg_topics}
\alias{pkg_topics}
\title{List the topics documented by a package}
\usage{
pkg_topics(package)
}
\arguments{
\item{package}{A package name, or a path to the source directory of a
package.}
}
\value{
A named character vector mapping alias to Rd file name.
}
\description{
\code{pkg_topics()} returns a named character vector mapping every alias
(i.e. everything you can type after \verb{?}) to the name of the Rd file
(without extension) that documents it. It understands three kinds of
package:
\itemize{
\item \strong{Installed} packages, read from their \code{help/aliases.rds} index.
\item \strong{In-development} packages loaded with \code{pkgload::load_all()},
indexed from the \verb{\\alias\{\}} commands in their source \verb{man/} directory.
\item \strong{Source} packages, when \code{package} is a path to a package directory
rather than a name.
}

Indexes remain cached until \code{\link[=pkg_cache_reset]{pkg_cache_reset()}} is called. Installed package
indexes are also reset automatically when their namespace is unloaded.

For source packages, \verb{\\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"))
}
