esearch_1: ~~function to do ... ~~

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

1
ESearch(db = "pubmed", term, usehistory = c("y", "n"), ...)

Arguments

db

~~Describe db here~~

term

~~Describe term here~~

usehistory

~~Describe usehistory here~~

...

~~Describe ... here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1

Description of 'comp1'

comp2

Description of 'comp2'

...

Note

~~further notes~~

~Make other sections like Warning with Warning .... ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

 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
32
33
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(db='pubmed',term,usehistory=c('y','n'),...) {
  params <- list(db=db,term=term,usehistory=usehistory,...)
  querystring <- EUtilsQueryString(params)
  urlbase <- EUtilsURLbase('eSearch')
  url <- paste(urlbase,querystring,sep="")
  xmlrawresult <- xmlRoot(xmlTreeParse(getURL(url)))
  if("ERROR" %in% names(xmlrawresult)) {
    errorval <- xmlValue(xmlrawresult[['ERROR']])
    warning(sprintf('Query [%s]\n generated ERROR: %s',querystring,errorval))
    result <- new('ESearchResult',error=errorval,
                  db=db,
                  queryparams=params,
                  xmlresult=xmlrawresult)
    return(result)
  }
  result <- new('ESearchResult',
                db=db,
                queryparams=params,
                xmlresult=xmlrawresult,
                webenv=ifelse(is.null(xmlrawresult[['WebEnv']]),NULL,xmlValue(xmlrawresult[['WebEnv']])),
                querykey=ifelse(is.null(xmlrawresult[['QueryKey']]),NULL,xmlValue(xmlrawresult[['QueryKey']])),
                queryurl=url,
                retstart=as.integer(xmlValue(xmlrawresult[['RetStart']])),
                retmax=as.integer(xmlValue(xmlrawresult[['RetMax']])),
                count=as.integer(xmlValue(xmlrawresult[['Count']])),
                querytranslation=xmlValue(xmlrawresult[['QueryTranslation']]))
  return(result)
  }

seandavi/rEutils documentation built on May 29, 2019, 4:54 p.m.