Description Usage Arguments Details Value Note Author(s) References See Also Examples
~~ A concise (1-5 lines) description of what the function does. ~~
1 |
db |
~~Describe |
term |
~~Describe |
usehistory |
~~Describe |
... |
~~Describe |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
~~further notes~~
~Make other sections like Warning with Warning .... ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.