HTMLInitFile: Begins / Ends a new HTML report output

Description Usage Arguments Value Note Author(s) See Also Examples

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

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

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

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

See Also

HTML, as.latex, HTMLgrid

Examples

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()

Example output



R2HTML documentation built on May 2, 2019, 5:11 p.m.

Related to HTMLInitFile in R2HTML...