% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/topic.R
\name{topic_rd}
\alias{topic_rd}
\title{Get the parsed Rd for a topic}
\usage{
topic_rd(topic, package)
}
\arguments{
\item{topic}{A single string.}

\item{package}{A package name, or a path to the source directory of a
package.}
}
\value{
An Rd object: a recursive structure of class \code{"Rd"}, as returned
by \code{\link[tools:parse_Rd]{tools::parse_Rd()}}. Returns \code{NULL} if the package or topic doesn't
exist; use \code{\link[=topic_exists]{topic_exists()}} first if you need to distinguish that from
other problems.
}
\description{
Retrieves the parsed Rd object documenting \code{topic} in \code{package}. For
installed packages the topic is fetched lazily from the package's help
database (no parsing needed); for source and in-development packages the
Rd file is parsed with \code{\link[tools:parse_Rd]{tools::parse_Rd()}}, with the package's Rd macros
loaded. Results are cached per topic, so repeated access (e.g. roxygen2
inheriting several fields from one topic) only pays once.
}
\examples{
rd <- topic_rd("rnorm", "stats")
class(rd)
}
