insert_all_ref: Insert references cited in packages

Description Usage Arguments Details Value Author(s) References Examples

View source: R/bib.R

Description

Insert references cited in packages.

Usage

1
insert_all_ref(refs, style = "")

Arguments

refs

a matrix specifying key-package pairs of the references to insert, see Details.

style

a bibstyle, see Details.

Details

insert_all_ref is the workhorse behind several Rd macros for inclusion of references in Rd documentation.

Argument refs is a two-column character matrix. The first column specifies bibtex keys. To specify more than one key in a single element, separate them by commas. The second row specifies the package in which to look for the keys.

A key equal to "*" requests in keys in the corresponding package.

insert_all_ref drops duplicated keys, collects the references, and converts them to Rd textual representation for inclusion in Rd documentation files.

Value

for insert_all_ref, a character string containing a textual representation of the references, suitable for inclusion in an Rd file

Author(s)

Georgi N. Boshnakov

References

Currently there are no citations. Nevethelese, I have put \insertAllCited{} just after this paragraph to show the message that it prints when there are no citations. This seems better than printing nothing but it may be argued also that there should be a warning as well.

\insertAllCited

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bibs <- bibtex::read.bib(package = "tools")
bibs


## a reference from package Rdpack
cat(insert_all_ref(matrix(c("Rpack:bibtex", "Rdpack"), ncol = 2)), "\n")

## more than one reference from package Rdpack, separate the keys with commas
cat(insert_all_ref(matrix(c("parseRd,Rpack:bibtex", "Rdpack"), ncol = 2)), "\n")

## all references from package Rdpack
cat(insert_all_ref(matrix(c("*", "Rdpack"), ncol = 2)), "\n")

GeoBosh/Rdpack documentation built on Oct. 29, 2018, 8:22 p.m.