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
|
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.,
An article from a journal or magazine.
A book with an explicit publisher.
A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
A part of a book having its own title.
An article in a conference proceedings.
Technical documentation like a software manual.
A Master's thesis.
Use this type when nothing else fits.
A PhD thesis.
The proceedings of a conference.
A report published by a school or other institution, usually numbered within a series.
A document having an author and title, but not formally published.
The ...
argument of citEntry
can be any number of
BibTeX fields, including
The address of the publisher or other type of institution.
The name(s) of the author(s), either
as a character string in the format described in the LaTeX book,
or a personList
object.
Title of a book, part of which is being cited.
A chapter (or section or whatever) number.
Name(s) of editor(s), same format as author
.
The publishing institution of a technical report.
A journal name.
Any additional information that can help the reader. The first word should be capitalized.
The number of a journal, magazine, technical report, or of a work in a series.
One or more page numbers or range of numbers.
The publisher's name.
The name of the school where a thesis was written.
The name of a series or set of books.
The work's title.
The volume of a journal or multi-volume book.
The year of publication.
basecit <- system.file("CITATION", package="base")
source(basecit, echo=TRUE)
readCitationFile(basecit)