Learn R Programming

reutils (version 0.1.1)

esearch: esearch - searching an Entrez database

Description

esearch performs searches using the the NCBI ESearch utility to retrieve primary UIDs matching a text query. These UIDs can be used in subsequent calls to esummary, efetch, or elink.

Usage

esearch(term, db = "nuccore", rettype = "uilist", retstart = 0,
  retmax = 100, usehistory = FALSE, webenv = NULL, querykey = NULL,
  field = NULL, datetype = NULL, reldate = NULL, mindate = NULL,
  maxdate = NULL)

Arguments

term
A valid Entrez text query.
db
Database to search (default: nuccore).
rettype
Retrieval type. (default: 'uilist', alternative: 'count'.)
retstart
Numeric index of the first UID in the retrieved set to be shown in the XML output (default: 0).
retmax
Total number of UIDs to be retrieved (default: 100).
usehistory
If TRUE, search results are posted directly to the Entrez History Server so that they can be used in subsequent calls to esummary, efetch,
webenv
Web environment string returned by a previous call to esearch, epost or elink. When provided, esearc
querykey
query key returned by a previous call to esearch, epost or elink. When provided, esearch will
field
Optional. Search field used to limit the entire search term.
datetype
Optional. Type of date to limit the search. One of "mdat" (modification date), "pdat" (publication date) or "edat" (Entrez date)
reldate
Optional. Number of days back for which search items are returned.
mindate
Optional. Minimum date of search range. Format YYYY/MM/DD, YYYY/MM, or YYYY.
maxdate
Optional. Maximum date of search range. Format YYYY/MM/DD, YYYY/MM, or YYYY.

Value

  • An esearch object.

Details

See the official online documentation for NCBI's http://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch{EUtilities} for additional information on this EUtility.

See Also

Combine calls to ESearch with other EUtils: esummary, efetch, elink.

Accessor methods: content, getUrl, getError, database, uid, webenv, querykey.

Examples

Run this code
## Search PubMed for articles with the term "Chlamydia psittaci" in the
## title that were published in 2013.
pmid <- esearch("Chlamydia psittaci[titl] and 2013[pdat]", "pubmed")
pmid

## Extract the query results either as an XML tree or parsed into
## a character vector
xml <- content(pmid, "xml")
uids <- uid(pmid)

## Alternatively post the UIDs to the History Server.
pmid <- esearch("Chlamydia psittaci[titl] and 2013[pdat]", "pubmed", usehistory=TRUE)
pmid

## Associate new search results with the existing search results.
pmid2 <- esearch("Chlamydia psittaci[titl] and 2012[pdat]", "pubmed",
                 usehistory=TRUE, webenv=webenv(pmid))
pmid2

Run the code above in your browser using DataLab