getRefs: Retrieve author references from Scopus and Crossref APIs

Description Usage Arguments Details Value See Also Examples

View source: R/getRefs.R

Description

This function queries the Scopus Search API to returned a list of references for one specific author. Quality of metadata is increased by coupling Scopus results with a query of the Crossref API called using the package rcrossref. Results are returned as BibTeX files (one per reference) but user can also choose two other formats: YAML and JSON. The conversion is proceeded using pandoc and pandoc-citeproc (must be separately installed).

Usage

1
2
3
getRefs(api_key = NULL, author_id = NULL, date = NULL,
  sort = "pubyear", sleep = 5, folder = ".", format = c("bibtex",
  "yaml"), erase = FALSE)

Arguments

api_key

A string indicating the user Scopus API Key obtained from the Elsevier Developer Portal

author_id

A string indicating the Scopus identifier of the author for which references have to be retrieve

date

A string indicating the year (or a range of years) for which references have to be retrieve (if NULL, default, all references listed in Scopus for this author will be returned)

sort

A string indicating the field by which references will be ordered (one of artnum, citedby-count, publicationName, pubyear)

sleep

A positive numeric indicating the time interval (in seconds) between two consecutive Scopus queries (a Scopus query response is limited to 25 entries)

folder

A string indicating the folder (relative or absolute path) to write references

format

A string indicating the references format (the possible formats are bibtex, yaml and json)

erase

A boolean specifing if a reference that already exists in the folder must be rewritten (TRUE) or not (FALSE)

Details

Before using this function user has to get a free Scopus API Key from the Elsevier Developer Portal (https://dev.elsevier.com/user/registration). He also needs to know the author Scopus identifer by visiting the Scopus Author Search Portal (https://www.scopus.com/freelookup/form/author.uri). This function works in four steps: 1) Get a list of references from Scopus API and keep only those with a DOI (all fields are returned except the authors list); 2) Complete the metadata (mainly the authors list) using the Crossref API called by the function cr_cn (request by DOI); 3) Merge metadata from the two sources and keep the best (hopefully); 4) Write references (one file per reference) in the specified formats using pandoc-citeproc (for YAML and JSON). We strongly recommend to convert references in YAML (and also keep BibTeX formats) because this step (performed with pandoc-citeproc) translates a large amount of LaTeX tags (mainly accented characters). But if you prefer you can also export references in BibTeX and then use the function bib2yaml to convert them in YAML.

Value

A list of BibTeX strings. BibTeX (if required) and other specified formats are also written in the directory specified by the argument folder.

See Also

bib2yaml, cleanRefs

Examples

1
# Coming soon...

inSileco/refR documentation built on May 28, 2019, 9:55 p.m.