write.htmltable {arrayMagic} | R Documentation

## Write a data frame into an html table within a html page

### Description

Write a `data.frame` into an html table within a html page

### Usage

    write.htmltable(x, filename, title="", sortby=NULL, decreasing=TRUE,
        open="wt", formatNumeric=function(x) paste(signif(x, 3)))

### Arguments

`x` | `data.frame`.
`filename` | character. File name.
`title` | character. Title of html page.
`sortby` | character. Name of column by which to sort the table rows.
`decreasing` | logical. Should the sort order be increasing or decreasing?
`open` | character. This argument is passed on to `file`.
`formatNumeric` | function that takes a numeric and returns a character. This function is called for all numeric values in the table.

### Details

### Value

The function is called for its side effect: writing a file.

### Author(s)

Wolfgang Huber http://www.dkfz.de/mga/whuber

### See Also

`writeToFile`

### Examples

    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="")

[Package arrayMagic version 1.14.0 Index]