Learn R Programming

revtools (version 0.4.1)

extract_unique_references: Create a de-duplicated data.frame

Description

Take a data.frame of bibliographic information showing potential duplicates (as returned by find_duplicates), and return a data.frame of unique references.

Usage

extract_unique_references(x, matches)

Arguments

x

a data.frame to be subsetted

matches

either a vector of matches, e.g. as returned from find_duplicates, or a column name (specified as a number or a string) from x showing where matches are stored

Value

a subsetted data.frame containing one entry for each group identified in matches.

See Also

find_duplicates for duplicate identification; screen_duplicates for an interactive alternative to duplicate removal.

Examples

Run this code
# NOT RUN {
# import data
file_location <- system.file(
  "extdata",
  "avian_ecology_bibliography.ris",
  package = "revtools"
)
x <- read_bibliography(file_location)

# generate duplicated references (for example purposes)
x_duplicated <- rbind(x, x[1:5,])

# locate and extract unique references
x_check <- find_duplicates(x_duplicated)
x_unique <- extract_unique_references(x_duplicated, matches = x_check)
# }

Run the code above in your browser using DataLab