| html {Hmisc} | R Documentation |
html is a generic function, for which only two methods are currently
implemented, html.latex and a rudimentary
html.data.frame. The former uses the HeVeA LaTeX to HTML
translator by Maranget to create an HTML file from a LaTeX file like
the one produced by latex. The resulting HTML file may be
displayed using a show or a print method. The browser
specified in options(browser=) for R (help.browser for
S-Plus) is launched to display the HTML file. html.default just
runs html.data.frame.
html(object, ...)
## S3 method for class 'latex'
html(object, file, where=c('cwd', 'tmp'),
method=c('htlatex', 'hevea'), cleanup=TRUE, ...)
## S3 method for class 'data.frame'
html(object,
file=paste(first.word(deparse(substitute(object))),'html',sep='.'),
append=FALSE, link=NULL, linkCol=1, linkType=c('href','name'), ...)
## Default S3 method:
html(object,
file=paste(first.word(deparse(substitute(object))),'html',sep='.'),
append=FALSE, link=NULL, linkCol=1, linkType=c('href','name'), ...)
## S3 method for class 'html'
print(x, ...)
## S3 method for class 'html'
show(object)
object |
a data frame or an object created by |
file |
name of the file to create. The default file
name is |
where |
for |
method |
default is to use system command |
cleanup |
if using |
append |
set to |
link |
character vector specifying hyperlink names to attach to
selected elements of the matrix or data frame. No hyperlinks are used
if |
linkCol |
column number of |
linkType |
defaults to |
... |
ignored |
x |
an object created by |
print or show launch a browser
Frank E. Harrell, Jr.
Department of Biostatistics,
Vanderbilt University,
f.harrell@vanderbilt.edu
Maranget, Luc. HeVeA: a LaTeX to HTML translater. URL: http://para.inria.fr/~maranget/hevea/
## Not run:
x <- matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','e')))
w <- latex(x)
h <- html(w) # run HeVeA to convert .tex to .html
h <- html(x) # convert x directly to html
h # launch html browser by running print.html
w <- html(x, link=c('','B')) # hyperlink first row first col to B
# Assuming system package tex4ht is installed, easily convert advanced
# LaTeX tables to html
getHdata(pbc)
s <- summaryM(bili + albumin + stage + protime + sex + age + spiders ~ drug,
data=pbc, test=TRUE)
w <- latex(s, npct='slash', file='s.tex')
z <- html(w)
browseURL(z$file)
d <- describe(pbc)
w <- latex(d, file='d.tex')
z <- html(w)
browseURL(z$file)
## End(Not run)