Fetch Metadata for a Study Identifier (DOI or PMID)
df_fetch_metadata.RdRetrieves bibliographic metadata (title, abstract, authors, year, journal) for a given DOI or PMID using online services (Crossref, PubMed).
Arguments
- identifier
Character string. The DOI or PMID of the study.
Character string (optional). Your email address, recommended for NCBI Entrez politeness when fetching from PubMed. If not provided,
rentrezmight issue a warning.- ncbi_api_key
Character string (optional). Your NCBI API key for potentially higher rate limits. Set using
rentrez::set_entrez_key().
Value
A list containing the fetched metadata (identifier, type, title,
abstract, authors, year, journal) or NULL if fetching fails or the
identifier type is not recognized. Issues warnings on failure.
Examples
if (FALSE) { # \dontrun{
# Fetch metadata for a known PMID (requires internet connection)
pmid_meta <- df_fetch_metadata("25376210", email = "your.email@example.com")
print(pmid_meta)
# Fetch metadata for a known DOI (requires internet connection and rcrossref)
doi_meta <- df_fetch_metadata("10.1038/nature14539", email = "your.email@example.com")
print(doi_meta)
# Example of a potentially invalid identifier
invalid_meta <- df_fetch_metadata("invalid-id")
print(invalid_meta)
} # }