update_citekeys: Update citekeys using fuzzy string matching

Description Usage Arguments Value Examples

View source: R/RFunctions.R

Description

When a new version of Zotero is released, sometimes, citekeys are changed, thereby breaking references in an existing Rmarkdown file. This function:

  1. Takes in a text string, and a file path to the .bib file

  2. Extracts citekeys from both the text string and bib file

  3. Uses fuzzy matching to replace the citekeys in text with the most likely matching citekeys from bibfile.

Usage

1

Arguments

text

Character string. Text from an Rmarkdown file.

bibfile

Character string. Path to .bib file.

...

Arguments passed to agrep

Value

A character string.

Examples

1
2
3
4
## Not run: 
update_citekeys(readLines("clipboard"), "references.bib")

## End(Not run)

cjvanlissa/motley documentation built on Sept. 23, 2019, 7:39 p.m.