\HeaderA{write.htmltable}{Write a data frame into an html table within a html page}{write.htmltable}
\keyword{IO}{write.htmltable}
\begin{Description}\relax
Write a \code{data.frame} into an html table within a html page
\end{Description}
\begin{Usage}
\begin{verbatim}
write.htmltable(x, filename, title="", sortby=NULL, decreasing=TRUE,
    open="wt", formatNumeric=function(x) paste(signif(x, 3)))\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] \code{data.frame}.
\item[\code{filename}] character. File name.
\item[\code{title}] character. Title of html page.
\item[\code{sortby}] character. Name of column by which to sort the table rows.
\item[\code{decreasing}] logical. Should the sort order be increasing or decreasing?
\item[\code{open}] character. This argument is passed on to \code{\LinkA{file}{file}}.
\item[\code{formatNumeric}] function that takes a numeric and returns a
character. This function is called for all numeric values in the table.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\end{Details}
\begin{Value}
The function is called for its side effect: writing a file.
\end{Value}
\begin{Author}\relax
Wolfgang Huber \url{http://www.dkfz.de/mga/whuber}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{writeToFile}{writeToFile}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
out = tempfile()

n  = 10
ex = data.frame(genename=paste("Gene", 1:n, sep=""),
                score   =signif(16*runif(n)),
                database=paste("http://super.data.base/?id", round(1e9*runif(n)), sep=""))

write.htmltable(ex, out, "Hi there", sortby="score")

cat("Now have a look at ", out, ".html\n", sep="")
\end{ExampleCode}
\end{Examples}

