citations: Gather citations for methods used with a snpRdata object

View source: R/utility_functions.R

citationsR Documentation

Gather citations for methods used with a snpRdata object

Description

snpR will automatically track the methods used for calculations on a snpRdata object. Using citations on that object will provide details on the the methods used, and can optionally write a .bib bibtex formatted library containing citations for these methods.

Usage

citations(x, outbib = FALSE, return_bib = FALSE)

Arguments

x

snpRdata object

outbib

character, default FALSE. An optional file path to which a .bib bibtex library containing all of the citations for the used methods will be written.

return_bib

logical, default FALSE. If TRUE, returns a list containing the bib entries and their details. The bib entries are formatted according to readBib.

Details

Printed outputs contain the statistic calculated, the in-line citation for the method used, a bibtex key which corresponds to the .bib library written if the outbib argument is used, and a quick note giving any details.

Value

If return_bib is TRUE, a list containing four parts:

  • keys: A vector of bibtex keys for each method.

  • stats: A vector of the stats used.

  • details: A vector of details for each method.

  • bib: A bibentry for each citation, see readBib.

Author(s)

William Hemstrom

Examples

# calculate pi
x <- calc_pi(stickSNPs)

# fetch citations
citations(x)

# fetch citations and write bibtex .bib to citations.bib
## not run
## Not run: 
citations(x, outbib = "citations.bib")

## End(Not run)

hemstrow/snpR documentation built on March 20, 2024, 7:03 a.m.