Learn R Programming

reutils (version 0.2.2)

einfo: einfo - getting database statistics and search fields

Description

einfo queries the NCBI EInfo utility to retrieve the names of all valid Entrez databases, or, if db is provided, to retrieve statistics for a single database, including lists of indexing fields and available link names. Version 2.0 data is requested by default.

Usage

einfo(db = NULL, version = "2.0", retmode = "xml")

Arguments

db
A valid NCBI database name. If NULL, a list of all current NCBI databases is returned.
version
Specifies version 2.0 EInfo XML. Set to NULL for the older version.
retmode
'xml' (default) or 'json'.

Value

An einfo object.

Details

See the official online documentation for NCBI's EUtilities for additional information.

See Also

content, getUrl, getError.

Examples

Run this code
## Not run: 
# ## Fetch a list of all current Entrez database names
# einfo()
# 
# ## Fetch statistics for an Entrez database and parse
# ## the data into a data.frame
# x <- einfo("gene")
# if (x$no_errors()) {
#   content(x, "parsed")
# }
# 
# 
# 
# ## Fetch statistics for an Entrez database in JSON format
# ## and parse the data into a list
# x <- einfo("pubmed", retmode = "json")
# if (x$no_errors()) {
#   content(x, "parsed")
# }
# ## End(Not run)

Run the code above in your browser using DataLab