Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

toHTML

Create an HTML representation of the given R object, using internal C-level nodes


Description

This generic function and the associated methods are intended to create an HTML tree that represents the R object in some intelligent manner. For example, we represent a vector as a table and we represent a matrix also as a table.

Usage

toHTML(x, context = NULL)

Arguments

x

the R object which is to be represented via an HTML tree

context

an object which provides context in which the node will be used. This is currently arbitrary. It may be used, for example, when creating HTML for R documentation and providing information about variabes and functions that are available on that page and so have internal links.

Details

It would be nicer if we could pass additional arguments to control whether the outer/parent layer is created, e.g. when reusing code for a vector for a row of a matrix.

Value

an object of class XMLInternalNode

Author(s)

Duncan Temple Lang

See Also

The R2HTML package.

Examples

cat(as(toHTML(rnorm(10)), "character"))

XML

Tools for Parsing and Generating XML Within R and S-Plus

v3.99-0.10
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>), Tomas Kalibera [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.