toHTML: Create an HTML representation of the given R object, using...

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


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.


toHTML(x, context = NULL)



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


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.


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.


an object of class XMLInternalNode


Duncan Temple Lang

See Also

The R2HTML package.


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

Search within the XML package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.