Learn R Programming

pubmedR (version 1.0.2)

pmExtractReferences: Extract references from PubMed XML records

Description

Walks a result returned by pmApiRequest or pmFetchById and pulls the <ReferenceList> block out of every record. Returns one row per cited <Reference>, carrying the source PMID, the free-text citation, and (when present) the cited PMID and DOI parsed from <ArticleIdList>.

Usage

pmExtractReferences(P)

Value

A data.frame with columns

source_pmidThe PMID of the article that cites the reference.
citationThe free-text <Citation> string from PubMed.
pmidThe PMID of the cited reference (if available).
doiThe DOI of the cited reference (if available).

Returns an empty data.frame (with the same schema) if no references are found.

Arguments

P

A list following the PubMed XML structure produced by pmApiRequest() or pmFetchById(). Must contain a $data element with one entry per record.

Details

Reference data in PubMed XML is populated when the publisher submits a <ReferenceList> block to NLM (which is now common, but not universal). This function does not call any web API; it merely parses what is already present in the XML. Use pmEnrichCitations to also resolve cited PMIDs into structured WoS-style citation strings.

See Also

pmEnrichCitations, pmFetchById

Examples

Run this code
# \donttest{
D <- pmFetchById("37289732")
refs <- pmExtractReferences(D)
head(refs)
# }

Run the code above in your browser using DataLab