EVOLUTION-MANAGER
Edit File: cite.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Cite a Bibliography Entry</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for cite {utils}"><tr><td>cite {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Cite a Bibliography Entry</h2> <h3>Description</h3> <p>Cite a <code>bibentry</code> object in text. The <code>cite()</code> function uses the <code>cite()</code> function from the default <code><a href="../../tools/html/bibstyle.html">bibstyle</a></code> if present, or <code>citeNatbib()</code> if not. <code>citeNatbib()</code> uses a style similar to that used by the LaTeX package <span class="pkg">natbib</span>. </p> <h3>Usage</h3> <pre> cite(keys, bib, ...) citeNatbib(keys, bib, textual = FALSE, before = NULL, after = NULL, mode = c("authoryear", "numbers", "super"), abbreviate = TRUE, longnamesfirst = TRUE, bibpunct = c("(", ")", ";", "a", "", ","), previous) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>keys</code></td> <td> <p>A character vector of keys of entries to cite. May contain multiple keys in a single entry, separated by commas. </p> </td></tr> <tr valign="top"><td><code>bib</code></td> <td> <p>A <code>"<a href="bibentry.html">bibentry</a>"</code> object containing the list of documents in which to find the keys. </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments to pass to the <code>cite()</code> function for the default style. </p> </td></tr> <tr valign="top"><td><code>textual</code></td> <td> <p>Produce a “textual” style of citation, i.e. what <code>\citet</code> would produce in LaTeX. </p> </td></tr> <tr valign="top"><td><code>before</code></td> <td> <p>Optional text to display before the citation. </p> </td></tr> <tr valign="top"><td><code>after</code></td> <td> <p>Optional text to display after the citation. </p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>The “mode” of citation. </p> </td></tr> <tr valign="top"><td><code>abbreviate</code></td> <td> <p>Whether to abbreviate long author lists. </p> </td></tr> <tr valign="top"><td><code>longnamesfirst</code></td> <td> <p>If <code>abbreviate == TRUE</code>, whether to leave the first citation long. </p> </td></tr> <tr valign="top"><td><code>bibpunct</code></td> <td> <p>A vector of punctuation to use in the citation, as used in <span class="pkg">natbib</span>. See the Details section. </p> </td></tr> <tr valign="top"><td><code>previous</code></td> <td> <p>A list of keys that have been previously cited, to be used when <code>abbreviate == TRUE</code> and <code>longnamesfirst == TRUE</code> </p> </td></tr> </table> <h3>Details</h3> <p>Argument names are chosen based on the documentation for the LaTeX <span class="pkg">natbib</span> package. See that documentation for the interpretation of the <code>bibpunct</code> entries. </p> <p>The entries in <code>bibpunct</code> are as follows: </p> <ol> <li><p> The left delimiter. </p> </li> <li><p> The right delimiter. </p> </li> <li><p> The separator between references within a citation. </p> </li> <li><p> An indicator of the “mode”: <code>"n"</code> for numbers, <code>"s"</code> for superscripts, anything else for author-year. </p> </li> <li><p> Punctuation to go between the author and year. </p> </li> <li><p> Punctuation to go between years when authorship is suppressed. </p> </li></ol> <p>Note that if <code>mode</code> is specified, it overrides the mode specification in <code>bibpunct[4]</code>. Partial matching is used for <code>mode</code>. </p> <p>The defaults for <code>citeNatbib</code> have been chosen to match the JSS style, and by default these are used in <code>cite</code>. See <code><a href="../../tools/html/bibstyle.html">bibstyle</a></code> for how to set a different default style. </p> <h3>Value</h3> <p>A single element character string is returned, containing the citation. </p> <h3>Author(s)</h3> <p>Duncan Murdoch </p> <h3>Examples</h3> <pre> ## R reference rref <- bibentry( bibtype = "Manual", title = "R: A Language and Environment for Statistical Computing", author = person("R Core Team"), organization = "R Foundation for Statistical Computing", address = "Vienna, Austria", year = 2013, url = "https://www.R-project.org/", key = "R") ## 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, author of parallel support", email = "ripley@stats.ox.ac.uk") ), year = "2012", note = "R package version 1.3-4", url = "https://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" ) ) ## Combine and cite refs <- c(rref, bref) cite("R, boot-package", refs) ## Cite numerically savestyle <- tools::getBibstyle() tools::bibstyle("JSSnumbered", .init = TRUE, fmtPrefix = function(paper) paste0("[", paper$.index, "]"), cite = function(key, bib, ...) citeNatbib(key, bib, mode = "numbers", bibpunct = c("[", "]", ";", "n", "", ","), ...) ) cite("R, boot-package", refs, textual = TRUE) refs ## restore the old style tools::bibstyle(savestyle, .default = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>