Learn R Programming

hwriter (version 0.93)

hwrite: HTML writer

Description

Outputs an R object in HTML format.

Usage

hwrite(x, page=NULL, ...)

Arguments

x
an R object to output in HTML format. Objects of type character, vector, matrix and data.frame are currently supported.
page
an optional connection, a character string naming the file to write to or a page object returned by openPage.
...
optional arguments depending on the type of x. See Details.

Value

  • A character string containing the output HTML code.

Details

Depending on its type and its length, x is written as a character string, a character vector or as an HTML table.

Many optional arguments can be used to render an R object. Arguments are listed below and rendering examples are shown in Examples.

Following optional arguments can be always used, independently of the type of x:

[object Object],[object Object]

See Also

openPage, closePage, hwriteImage, hmakeTag.

Examples

Run this code
## Short example	
 tmpdir <- tempdir()
 p <- openPage('test.html', dirname=tmpdir)
 hwrite('Iris', p, center=TRUE, heading=1)
 hwrite(iris[1:10,], p, row.bgcolor='#ffccaa')
 closePage(p)
 if (interactive()) try(browseURL(file.path(tmpdir, 'test.html')))
 
 ## Long example
 hwriter:::showExample()

Run the code above in your browser using DataLab