\HeaderA{citation}{Citing R and R Packages in Publications}{citation}
\aliasA{toBibtex.citation}{citation}{toBibtex.citation}
\aliasA{toBibtex.citationList}{citation}{toBibtex.citationList}
\keyword{misc}{citation}
\begin{Description}\relax
How to cite R and R packages in publications.
\end{Description}
\begin{Usage}
\begin{verbatim}
citation(package = "base", lib.loc = NULL)
## S3 method for class 'citation':
toBibtex(object, ...)
## S3 method for class 'citationList':
toBibtex(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\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.
\item[\code{object}] return object of \code{citation}.
\item[\code{...}] currently not used.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The R core development team and the very active community of package
authors have invested a lot of time and effort in creating R as it is
today. Please give credit where credit is due and cite R and R
packages when you use them for data analysis.

Execute function \code{citation()} for information on how to cite the
base R system in publications. If the name of a non-base package is
given, the function
either returns the information contained in the \code{\LinkA{CITATION}{CITATION}}
file of the package or auto-generates citation information. In the
latter case the package \file{DESCRIPTION} file is parsed, the
resulting citation object may be arbitrarily bad, but is quite useful
(at least as a starting point) in most cases.

If only one reference is given, the print method shows both a text
version and a BibTeX entry for it, if a package has more than one
reference then only the text versions are shown. The BibTeX versions
can be obtained using function \code{toBibtex} (see the examples below).
\end{Details}
\begin{Value}
An object of class \code{"citationList"}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{citEntry}{citEntry}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## the basic R reference
citation()

## references for a package -- might not have these installed
if(nchar(system.file(package="lattice"))) citation("lattice")
if(nchar(system.file(package="foreign"))) citation("foreign")

## extract the bibtex entry from the return value
x <- citation()
toBibtex(x)
\end{ExampleCode}
\end{Examples}

