HTMLInitFile {R2HTML}R Documentation

Begins / Ends a new HTML report output

Description

Those two functions handle the beginning and the ending of a HTML report, by writing the HTML <body><head><title></title></head>...</body> tags and their options. When working manually, the user may need to use it's own functions or to explicitly write to a file using cat("", file=).

Usage

HTMLInitFile(outdir = tempdir(),filename="index",extension="html",HTMLframe=FALSE, BackGroundColor = "FFFFFF", BackGroundImg = "", Title = "R output",CSSFile="R2HTML.css",useLaTeX=TRUE,useGrid=TRUE)
HTMLEndFile(file = .HTML.file)

Arguments

outdir directory to store the output
filename target HTML report filename
extension target HTML report extension (htm, html,...)
HTMLframe should the output be handled by frames [boolean]
BackGroundColor option bgcolor for HTML tag <body>
BackGroundImg option background for HTML tag <body>
Title string to pass to HTML <title> tag
CSSFile path and name of a CSS file to use
useLaTeX boolean - add required references to javascript AsciiMathML in order to use as.latex
useGrid boolean - add required references to javascript grid in order to use R2HTML grid fonctions
file target HTML file to end

Details

Value

physical path of the main HTML file that will serve for the report.

Note

For a discussion about .HTML.file default value for file argument, refer to HTMLStart

Author(s)

Eric Lecoutre

References

See Also

HTML, as.latex, HTMLgrid

Examples

        # Store in target the name of a output file
        dir.create(file.path(tempdir(),"R2HTML"))
        target <- HTMLInitFile(file.path(tempdir(),"R2HTML"),"index", BackGroundColor="#BBBBEE")
        # Use target to write a dataframe
        HTML(as.title("Here is the data frame"),file=target)
        HTML("<br>Don't forget to use the CSS file in order to benefit from fixed size police",file=target)
        tmp <- as.data.frame(matrix(rnorm(100),ncol=10))
        HTML(tmp,file=target)
        HTMLEndFile()

[Package R2HTML version 1.58 Index]