Description Usage Arguments Methods (by class) See Also Examples
There are five ways to access data returned by an Entrez request: as a character
string (as = "text"), as a textConnection
(as = "textConnection"), as an XMLInternalDocument
(as = "xml") or json object (as = "json")
(depending on the retmode with which the request was performed),
or parsed into a native R object, e.g. a list or a data.frame
(as = "parsed").
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | content(x, ...)
## S4 method for signature 'eutil'
content(x, ...)
## S4 method for signature 'ecitmatch'
content(x, as = "text")
## S4 method for signature 'efetch'
content(x, as = NULL)
## S4 method for signature 'egquery'
content(x, as = NULL)
## S4 method for signature 'einfo'
content(x, as = NULL)
## S4 method for signature 'elink'
content(x, as = NULL)
## S4 method for signature 'epost'
content(x, as = NULL)
## S4 method for signature 'esearch'
content(x, as = NULL)
## S4 method for signature 'espell'
content(x, as = NULL)
## S4 method for signature 'esummary'
content(x, as = NULL)
|
x |
An |
... |
Further arguments passed on to methods. |
as |
Type of output: |
eutil: Access the data content from an eutil object.
ecitmatch: Return PubMed IDs if as = "parsed".
efetch: Access the data content from an efetch request.
egquery: Access the data content from an egquery request.
einfo: Access the data content from an einfo request.
elink: Access the data content from an elink request.
epost: Access the data content from an epost request.
esearch: Access the data content from an esearch request.
espell: Access the data content from an espell request.
esummary: Access the data content from an esummary request.
einfo, esearch, esummary,
efetch, elink, epost,
egquery, espell, ecitmatch.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
## einfo() defaults to retmode 'xml'
e <- einfo()
## automatically return data as an 'XMLInternalDocument'.
if (e$no_errors()) {
content(e)
## return the XML data as character string.
cat(content(e, "text"))
## return DbNames parsed into a character vector.
content(e, "parsed")
}
## return data as a JSON object
e2 <- einfo(db = "gene", retmode = "json")
if (e2$no_errors()) {
content(e2)
}
## return a textConnection to allow linewise reading of the data.
x <- efetch("CP000828", "nuccore", rettype = "gbwithparts", retmode = "text")
con <- content(x, as = "textConnection")
readLines(con, 2)
close(con)
## End(Not run)
|
Warning: CurlError: Could not resolve host: eutils.ncbi.nlm.nih.gov
Warning: CurlError: Could not resolve host: eutils.ncbi.nlm.nih.gov
Warning: CurlError: Could not resolve host: eutils.ncbi.nlm.nih.gov
[1] ""
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.