Learn R Programming

pubmedtk (version 1.0.4)

get_metadata_from_one_pmid: Downloads metadata from Pubmed API for a single provided PMID and exports

Description

Downloads metadata from Pubmed API for a single provided PMID and exports

Usage

get_metadata_from_one_pmid(pmid, api_key)

Value

A named list with 7 elements:

`$pubmed_dl_success`, which is TRUE in the case that a
corresponding Pubmed record was found and metadata
downloaded and FALSE otherwise.

`$doi`, a character string containing the DOI for the publication with the PMID in question.

`$languages`, a list of languages corresponding to the publication with the PMID in question.

`$pubtypes`, a list of publication types corresponding to the publication with the PMID in question.

`$pubdate`, the listed publication date

`$epubdate`, the listed e-publication date

`$authors`, a list of authors of the publication with the PMID in question.

`$abstract`, a character string containing the abstract for the publication with the PMID in question.

Arguments

pmid

A single PMID, e.g. "29559429"

api_key

A valid Pubmed API key

Examples

Run this code

if (FALSE) {
## Read in API key
ak <- readLines("api_key.txt")

## Download Pubmed metadata
mdata <- get_metadata_from_one_pmid("29559429", ak)

## Extract first author
mdata$authors[1]
}

Run the code above in your browser using DataLab