From a citation, extracts the title and searches the corresponding
DOI on the CrossRef database using the CrossRef API
(https://www.crossref.org/documentation/retrieve-metadata/rest-api/)
and the R package rcrossref
(https://cran.r-project.org/package=rcrossref).
Important: you need to share your email address with Crossref. See https://docs.ropensci.org/rcrossref/#register-for-the-polite-pool for further information.
The extraction of the title is performed by the function
title_from_citation
and may fail if the citation is malformed.
The candidate title (returned by the CrossRef API) is compared to the
original title, and the string distance is performed using the function
stringdist::stringdist
to have an idea of the match.
search_in_cr(x)
a character
of length 1. A citation written as
"Authors Year Title. Journal...". See title_from_citation
for further
detail.
A data.frame
with one row and the following 4 columns:
search_term
: the cleaned title extracted from the citation used as the
query terms in CrossRef API;
cr_best_title
: the title of the best reference returned by CrossRef;
cr_best_doi
: the DOI corresponding to the best reference returned by
CrossRef;
cr_string_dist
: the string distance (Optimal string aligment, osa
)
between the original title and the one returned by CrossRef.
See stringdist::stringdist
for further information.
if (FALSE) {
ref <- paste0("Quainoo, A.K., Wetten, A.C., Allainguillaume, J., 2008. The ",
"effectiveness of somatic embryogenesis in eliminating the ",
"cocoa swollen shoot virus from infected co- coa trees. ",
"J. Virol. Methods 149, 91e96.")
search_in_cr(ref)
}