get_records: Get PubMed records.

View source: R/get_records.R

get_recordsR Documentation

Get PubMed records.

Description

A wrapper around entrez_fetch, get_records fetches PubmedArticle records and stores the records in a tidy dataframe suitable for processing using tools from the tidyverse.

Usage

get_records(
  search_terms,
  pub_type = "journal article",
  api_key = NULL,
  date_type = "PDAT",
  min_date = "1966/01/01",
  max_date = format(Sys.Date(), "%Y/%m/%d")
)

Arguments

search_terms

A character string of terms that define the scope of the PubMed database query. Boolean operators (AND, OR, NOT) and search field tags may be used to create more complex search criteria. Commonly used search fields tags include:

[TI]

Word in title

[TIAB]

Word in title or abstract

[MH]

Medical Subject Heading (MeSH)

[AU]

Author name (e.g., Doe J)

[AD]

Author institutional affiliation

[TA]

Journal title (e.g., J Pain)

For a full set of search fields tags: PubMed search field tags. Note that the article publication type, date type, and date range are modified using the pub_type, date_type, min_date and max_date arguments below.

pub_type

A character string specifying the type of publication the search must return. The default value is journal article. For more information: PubMed article types.

api_key

An API character string obtained from the users NCBI account. The key is not essential, but it specifying a key gives substantially faster record query rates.

date_type

A character string specifying the publication date type that is being specified in the search. Available values are:

PDAT

Date the article was published (default).

MDAT

Date the PubMed entry was modified.

EDAT

Date the entry was added to PubMed.

min_date

A character string in the format 'YYYY/MM/DD', 'YYYY/MM' or 'YYYY' specifying the starting date of the search. The default value is 1966/01/01'.

max_date

A character string in the format 'YYYY/MM/DD', 'YYYY/MM' or 'YYYY' specifying the end date of the search. The default value is Sys.Date().

Value

A long-format dataframe (each author of an article on a new row) with the following columns:

surname

Character string specifying author surname.

initials

Character string specifying author initials.

title

Character string specifying title of an article.

journal

Character string specifying the journal title (abbreviated title name).

status

Character string specifying publication status of an article (e.g., ahead of print.

volume

Character string specifying the journal volume.

pages

Character string specifying the page numbers of in print articles.

year_published

Character string specifying the year an article came out in print.

year_online

Character string specifying the year an article was added to the PubMed database.

pmid

Character string specifying the PubMed ID of an article.

doi

Character string specifying the DOI of an article.

abstract

Character string containing the full abstract of an article

See Also

entrez_search and entrez_fetch

Other related functions: count_records()


kamermanpr/pubmedRecords documentation built on Feb. 5, 2023, 1:22 a.m.