| bibentry {utils} | R Documentation |
Functionality for representing and manipulating bibliographic information in enhanced BibTeX style.
bibentry(bibtype, textVersion = NULL, header = NULL, footer = NULL,
key = NULL, ..., other = list(),
mheader = NULL, mfooter = NULL)
## S3 method for class 'bibentry'
print(x, style = "text", .bibstyle = "JSS", ...)
bibtype |
a character string with a BibTeX entry type. See Entry Types for details. |
textVersion |
a character string with a text representation of the reference to optionally be employed for printing. |
header |
a character string with optional header text. |
footer |
a character string with optional footer text. |
key |
a character string giving the citation key for the entry. |
... |
for bibentry: arguments of the form
tag=value giving the fields of the entry, with
tag and value the name and value of the field,
respectively. Arguments with empty values are dropped.
See Entry Fields for details.
For the |
other |
a list of arguments as in ... (useful in
particular for fields named the same as formals of
bibentry). |
mheader |
a character string with optional “outer” header text. |
mfooter |
a character string with optional “outer” footer text. |
x |
an object inheriting from class "bibentry". |
style |
a character string specifying the print style. Must be a unique abbreviation (with case ignored) of the available styles, see Details. |
.bibstyle |
a character string naming a bibliography style. |
The bibentry objects created by bibentry can represent an
arbitrary positive number of references. One can use c() to
combine bibentry objects, and hence in particular build a multiple
reference object from single reference ones. Alternatively, one can
use bibentry to directly create a multiple reference object by
“vectorizing” the given arguments, i.e., use character vectors
instead of character strings.
The print method for bibentry objects provides a choice
between six different styles:
plain text (style "text"),
BibTeX ("Bibtex"),
a mixture of plain text and BibTeX as traditionally used for citations
("citation"),
HTML (style "html"),
LaTeX (style "latex"),
and a simple copy of the textVersion elements (style
"textVersion").
The "text", "html" and "latex" styles make use
of the .bibstyle argument using the bibstyle
function. When printing bibentry objects in citation style, a
header/footer for each item can be displayed as well as
a mheader/mfooter for the whole vector of references.
There is also a toBibtex method for direct conversion to
BibTeX.
bibentry produces an object of class "bibentry".
bibentry creates "bibentry" objects, which are modeled
after BibTeX entries. The entry should be a valid BibTeX entry type,
e.g.,
The ... argument of bibentry can be any number of
BibTeX fields, including
person object.
author.
The bibentry functionality is still experimental.
## R reference
rref <- bibentry(
bibtype = "Manual",
title = "R: A Language and Environment for Statistical Computing",
author = person("R Development Core Team"),
organization = "R Foundation for Statistical Computing",
address = "Vienna, Austria",
year = 2010,
isbn = "3-900051-07-0",
url = "http://www.R-project.org/")
## Different printing styles
print(rref)
print(rref, style = "Bibtex")
print(rref, style = "citation")
print(rref, style = "html")
print(rref, style = "latex")
## References for boot package and associated book
bref <- c(
bibentry(
bibtype = "Manual",
title = "boot: Bootstrap R (S-PLUS) Functions",
author = c(
person("Angelo", "Canty", role = "aut", comment = "S original"),
person(c("Brian", "D."), "Ripley", role = c("aut", "trl", "cre"),
comment = "R port", email = "ripley@stats.ox.ac.uk")
),
year = "2010",
note = "R package version 1.2-42",
url = "http://CRAN.R-project.org/package=boot",
key = "boot-package"
),
bibentry(
bibtype = "Book",
title = "Bootstrap Methods and Their Applications",
author = as.person("Anthony C. Davison [aut], David V. Hinkley [aut]"),
year = "1997",
publisher = "Cambridge University Press",
address = "Cambridge",
isbn = "0-521-57391-2",
url = "http://statwww.epfl.ch/davison/BMA/",
key = "boot-book"
)
)
## Combining and subsetting
c(rref, bref)
bref[2]
## Extracting fields
bref$author
bref[1]$author
bref[1]$author[2]$email
## Convert to BibTeX
toBibtex(bref)