Learn R Programming

exams.forge (version 1.0.10)

toHTML.html_matrix: 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 html_matrix
toHTML(x, browser = FALSE, ...)

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

toHTMLorLatex(x, ...)

Value

character

Arguments

x, object

html_matrix object

browser

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

...

further parameters to utils::browseURL()

Examples

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

Run the code above in your browser using DataLab