\HeaderA{pubmed}{A function to open the browser to Pubmed with the selected gene.}{pubmed}
\keyword{interface}{pubmed}
\begin{Description}\relax
Given a vector of Pubmed identifiers or accession numbers, the user
can either have a browser display a URL showing a Pubmed query for
those identifiers, or a XMLdoc object with the same data.
\end{Description}
\begin{Usage}
\begin{verbatim}
pubmed(...,disp=c("data","browser"), type=c("uid","accession"),
       pmaddress=.pmfetch("PubMed", disp, type))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] Vectorized set of Pubmed ID's
\item[\code{disp}] Either "Data" or "Browser" (default is data).  Data
returns a XMLDoc, while Browser will display information in the
user's browser.
\item[\code{type}] Denotes whether the arguments are accession numbers or
UIDS.  Defaults to uids.
\item[\code{pmaddress}] Specific path to the pubmed pmfetch engine from the
NCBI website.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A simple function to retrieve Pubmed data given a specific ID, either
through XML or through a web browser.  This function will accept
either pubmed accession numbers or NCBI UIDs (defined as a Pubmed
ID or a Medline ID) - although the types must not be mixed in a single
call. 

WARNING:  The powers that be at NCBI have been known to ban the IP
addresses of users who abuse their servers (currently defined as
less then 2 seconds between queries).  Do NOT put this function in
a type loop or you may find your access revoked.
\end{Details}
\begin{Value}
If the option "data" is used, an object of type XMLDoc is returned,
unless there was an error with the query in which case an object of
type try-error is returned.

If the option "browser" is used, nothing is returned.
\end{Value}
\begin{Author}\relax
R. Gentleman
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{genbank}{genbank}}, \code{\LinkA{locuslinkByID}{locuslinkByID}},
\code{\LinkA{locuslinkQuery}{locuslinkQuery}}, \code{\LinkA{xmlTreeParse}{xmlTreeParse}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
   if( interactive() )
    opts <- c("data","browser") else
    opts <- "data"
   for (dp in opts)
     pubmed("11780146","11886385","11884611",disp=dp)
\end{ExampleCode}
\end{Examples}

