Learn R Programming

easyPubMed (version 3.1.6)

epm_query: Search for PubMed Records.

Description

Query PubMed (Entrez) via the PubMed API eSearch utility. Calling this function results in submitting a query to the NCBI EUtils server and then capturing and parsing the response. The number of records expected to be returned by the query is determined. If this number is bigger than n=10,000, the record retrieval job is automatically split in a list of smaller manageable sub-queries. This function returns an "easyPubMed" object, which includes all information required to retrieve PubMed records using the epm_fetch() function.

Usage

epm_query(query_string, api_key = NULL, verbose = TRUE)

Value

An easyPubMed object which includes no PubMed records.

Arguments

query_string

String (character vector of length 1), corresponding to the query string.

api_key

String (character vector of length 1), corresponding to the NCBI API key. Can be `NULL`.

verbose

logical, shall progress information be printed to console. Defaults to `TRUE`.

Author

Damiano Fantini, damiano.fantini@gmail.com

Details

This function will use "query_string" for querying PubMed. The Query Term can include one or multiple words, as well as the standard PubMed operators (AND, OR, NOT) and tags (i.e., [AU], [PDAT], [Affiliation], and so on).

References

https://www.data-pulse.com/dev_site/easypubmed/

Examples

Run this code
# Note: a time limit can be set in order to kill the operation when/if 
# the NCBI/Entrez server becomes unresponsive.
setTimeLimit(elapsed = 4.9)
try({
  qry <- 'Damiano Fantini[AU] AND "2018"[PDAT]'
  epm_query(query_string = qry, verbose = FALSE)
}, silent = TRUE)
setTimeLimit(elapsed = Inf)



Run the code above in your browser using DataLab