Learn R Programming

knitcitations (version 0.4-7)

citep: Add a paranthetical citation

Description

Add a paranthetical citation

Usage

citep(x, ..., format_inline_fn = format_authoryear_p,
    inline_format = authoryear_p, page = NULL)

Arguments

x
a doi or list of dois, or a bibentry (or list of bibentries)
inline_format
a function for formating the inline citation, defaults to authoryear_t
format_inline_fn
function to format a single inline citation
...
additional arguments passed to citet, see citet for details
page
optional page or page range that can be given as extra text. Page ranges should be separated by hyphen, giving "pp.", while single page returns as "p." followed by page number.

Value

  • a parenthetical inline citation

Details

Stores the full citation in a "works_cited" list, which can be printed with bibliography A variety of reasons for the citation can be provided following the CiTO ontology: c("cites","citesAsAuthority", "citesAsMetadataDocument", "citesAsSourceDocument","citesForInformation", "isCitedBy","obtainsBackgroundFrom", "sharesAuthorsWith", "usesDataFrom", "usesMethodIn", "confirms", "credits", "extends", "obtainsSupportFrom", "supports", "updates", "corrects", "critiques", "disagreesWith", "qualifies", "refutes", "discusses", "reviews")

Examples

Run this code
library(knitcitations)
 ## (requires internet connection)
 citep("10.3998/3336451.0009.101")
 ## Read in the bibtex information for some packages:
 knitr <- citation("knitr")
 knitcitations <- citation("knitcitations")
 # generate the parentetical citation for these:
 citep(list(knitr,knitcitations))
 # generate the full bibliography:
 bibliography()
## Assign a citation key to a doi and then use it later:
citep(c(Halpern2006="10.1111/j.1461-0248.2005.00827.x"))
citep("Halpern2006")

Run the code above in your browser using DataLab