\HeaderA{system.file}{Find Names of R System Files}{system.file}
\keyword{file}{system.file}
\keyword{utilities}{system.file}
\begin{Description}\relax
Finds the full file names of files in packages etc.
\end{Description}
\begin{Usage}
\begin{verbatim}
system.file(..., package = "base", lib.loc = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] character strings, specifying subdirectory and file(s)
within some package.  The default, none, returns the
root of the package.  Wildcards are not supported.
\item[\code{package}] a character string with the name of a single package.
An error occurs if more than one package name is given.
\item[\code{lib.loc}] a character vector with path names of \R{} libraries, or
\code{NULL}.  The default value of \code{NULL} corresponds to all
libraries currently known.  If the default is used, the loaded
packages are searched before the libraries.
\end{ldescription}
\end{Arguments}
\begin{Value}
A character vector of positive length, containing the file names
that matched \code{...}, or the empty string, \code{""}, if none
matched.  If matching the root of a package, there is no trailing
separator.

As a special case, \code{system.file()} gives the root of the
\pkg{base} package only.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{R.home}{R.home}} for the root directory of the \R{}
installation, \code{\LinkA{list.files}{list.files}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
system.file()                  # The root of the 'base' package
system.file(package = "stats") # The root of package 'stats'
system.file("INDEX")
system.file("help", "AnIndex", package = "splines")
\end{ExampleCode}
\end{Examples}

