Skip to content

Commit

Permalink
Remove warning msgs on summary extractors (been >1yr since last relea…
Browse files Browse the repository at this point in the history
…se with older esummary object)
  • Loading branch information
dwinter committed Jul 20, 2015
1 parent db9e426 commit c6462c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 57 deletions.
3 changes: 0 additions & 3 deletions NAMESPACE
@@ -1,8 +1,5 @@
# Generated by roxygen2 (4.1.1): do not edit by hand

S3method("$",esummary)
S3method("[",esummary)
S3method("[[",esummary)
S3method(as.data.frame,eInfoList)
S3method(print,eInfoEntry)
S3method(print,eInfoLink)
Expand Down
53 changes: 0 additions & 53 deletions R/entrez_summary.r
Expand Up @@ -150,59 +150,6 @@ parse_esumm_list <- function(node){
}



#' @export
`[[.esummary` <- function(x, name, ...){
res <- NextMethod("[[")
if(is.null(res)){
msg <- paste0("Esummary object '", deparse(substitute(x)), "' has no object",
" named '", name, "' \b.\nIf you were expecting values from a ",
" 'version 1.0' esummary record, try setting 'version' to ",
" '1.0' in entrez_summary (see documentation for more)\n")
warning(msg)
}
res
}


#' @export
`[.esummary` <- function(x, ...){
res <- NextMethod("[")
if(any(vapply(res, is.null, TRUE))){
msg <- paste("Some values missing from Esumamry object. If you were",
"expecting a 'Version 1.0' esummary record, try setting",
"'version' to '1.0' in entrez_summary()")
warning(msg)
}
res
}



#' @export
`$.esummary` <- function(x, name){
suppressWarnings(
res <- x[[name]]
)
if(!is.null(res)){
return(res)
}
suppressWarnings(res <- x[[name, exact=FALSE]])
if(!is.null(res) && getOption("warnPartialMatchDollar", default=FALSE)){
warning("Returning partial match")
return(res)
}
if(is.null(res)){
msg <- paste0("Esummary object '", deparse(substitute(x)), "' has no object",
" named '", name, "' \b.\nIf you were expecting values from a ",
" 'versoin 1.0' esummary record, try setting 'version' to ",
" '1.0' in entrez_summary (see documentation for more)\n")
warning(msg)
}
res
}


#' @export
print.esummary <- function(x, ...){
len <- length(x)
Expand Down
8 changes: 7 additions & 1 deletion man/entrez_link.Rd
Expand Up @@ -12,7 +12,7 @@ entrez_link(dbfrom, web_history = NULL, id = NULL, db = NULL,

\item{web_history}{a web_history object}

\item{id}{vector with unique ID(s) for reacods in database \code{db}.}
\item{id}{vector with unique ID(s) for records in database \code{db}.}

\item{db}{character Name of the database to search for links (or use "all" to
search all databases available for \code{db}. \code{entrez_db_links} allows you
Expand All @@ -35,13 +35,19 @@ to discover databases that might have linked information (see examples).}
each ID.
}}

\item{by_id}{logial If FALSE (default) return a single
\code{elink} objects containing links for all of the provided \code{id}s.
Alternatively, if TRUE return a list of \code{elink} objects, one for each
ID in \code{id}.}

\item{config}{vector configuration options passed to httr::GET}

\item{\dots}{character Additional terms to add to the request, see NCBI
documentation linked to in referenes for a complete list}
}
\value{
An elink object containing the data defined by the \code{cmd} argument
(if by_id=FALSE) or a list of such object (if by_id=TRUE).

file XMLInternalDocument xml file resulting from search, parsed with
\code{\link{xmlTreeParse}}
Expand Down

0 comments on commit c6462c2

Please sign in to comment.