| citEntry {utils} | R Documentation |
The ‘CITATION’ file of R packages contains an annotated list of references that should be used for citing the packages.
citEntry(entry, textVersion, header = NULL, footer = NULL, ...) citHeader(...) citFooter(...) readCitationFile(file, meta = NULL)
entry |
a character string with a BibTeX entry type |
textVersion |
a character string with a text representation of the reference |
header |
a character string with optional header text |
footer |
a character string with optional footer text |
file |
a file name |
... |
see details below |
meta |
a list of package metadata as obtained by
packageDescription, or NULL (default). |
The ‘CITATION’ file of an R package should be placed in the
‘inst’ subdirectory of the package source. The file is an R
source file and may contain arbitrary R commands including
conditionals and computations. The file is source()ed by the R
parser in a temporary environment and all resulting objects of class
"citation" (the return value of citEntry) are collected.
Typically the file will contain zero or more calls to citHeader,
then one or more calls to citEntry, and finally zero or more
calls to citFooter. citHeader and citFooter are
simply wrappers to paste, and their ... argument
is passed on to paste as is.
citEntry returns an object of class "citation",
readCitationFile returns an object of class "citationList".
citEntry creates "citation" objects, which are modeled
after BibTeX entries. The entry should be a valid BibTeX entry type,
e.g.,
The ... argument of citEntry can be any number of
BibTeX fields, including
personList object.author.
basecit <- system.file("CITATION", package="base")
source(basecit, echo=TRUE)
readCitationFile(basecit)