xCitations: Extract Citations from Text

Description Usage Arguments Details Value References Examples

View source: R/xCitations.R

Description

Extract citations from text by searching for parenthetical phrases with capital words (names) and 4-digit numbers (years)

Usage

1

Arguments

file

Character scalar indicating the name of the text file. Default value of NULL allows for text to be read in directly using the txt argument.

txt

Character scalar containing the text containing citations. Default value of NULL expects text to be read in from a file using the file argument.

Details

Citations in which the author is mentioned directly in the text and only the year is in parentheses are not captured with this function.

Value

A character vector of unique citations in alphabetical order.

References

Based on code posted by Kay Cichini on 26 Mar 2012 on theBioBucket [link].

Examples

1
2
3
4
5
x <- paste("Yarmouth (1977) said something.",
 "Evidence of x (Barber and Jones 1991),",
 "y (House et al. 1982),",
 "and z (Smith 1990; Folger and Penn 2000).")
xCitations(txt=x)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.