| 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’. |
meta |
a list of package metadata as obtained by
packageDescription, or NULL (the 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.
readCitationFile makes use of the Encoding element (if
any) of meta to determine the encoding of the file.
citEntry returns an object of class "citation", for
which there are print and toBibtex methods. This
is a named list of entries with attributes "entry",
"textversion" and optionally "header" and
"footer".
readCitationFile returns an object of class
"citationList", also with print and
toBibtex methods. This is a list of one or more
elements of class "citation" with optional attributes
"header" and "footer".
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)