Description Usage Arguments Value Note Author(s) See Also Examples
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=).
1 2 3 4 5 | HTMLInitFile(outdir = tempdir(), filename="index", extension="html",
HTMLframe=FALSE, BackGroundColor = "FFFFFF", BackGroundImg = "",
Title = "R output", CSSFile="R2HTML.css", useLaTeX=TRUE, useGrid=TRUE)
HTMLEndFile(file = get(".HTML.file"))
|
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 |
useGrid |
boolean - add required references to javascript grid in order to use R2HTML grid fonctions |
file |
target HTML file to end |
physical path of the main HTML file that will serve for the report.
For a discussion about .HTML.file default value for file argument, refer to HTMLStart
Eric Lecoutre
1 2 3 4 5 6 7 8 9 | # 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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.