toHTML: HTML and LaTeX Matrix Representations

toHTML.html_matrixR Documentation

HTML and LaTeX Matrix Representations

Description

  • toHTML returns an HTML representation of a matrix and, optionally, shows the result in the browser. If you decide to view the result in a browser then the HTML will be written to a temporary file and utils::browseURL() will be called

  • toLatex returns a LaTeX representation of a matrix, but supports just a small subset of style options

  • toHTMLorLatex returns an HTML or LaTeX representation of a matrix, depending if exams2pdf is in the call list or not

Usage

## S3 method for class 'html_matrix'
toHTML(x, browser = FALSE, ...)

## S3 method for class 'html_matrix'
toLatex(object, ...)

toHTMLorLatex(x, ...)

Arguments

x, object

html_matrix object

browser

logical: show the HTML in a browser (default: FALSE)

...

further parameters to utils::browseURL()

Value

character

Examples

library("tools")
m    <- matrix(1:12, ncol=4)
hm   <- html_matrix(m)
if (interactive()) html <- toHTML(hm, browser=TRUE)
toHTML(hm)
toLatex(hm)

exams.forge documentation built on Sept. 11, 2024, 5:32 p.m.