A function of an R package of the same name, used to convert an R object into an object that may be printed as a LaTeX or HTML table.
This function extracts tabular information from x and returns an object of class "xtable"
. The nature of the table generated depends on the class of x
. For example, aov
objects produce ANOVA tables while data.frame
objects produce a table of the entire data.frame
. One can optionally provide a caption (called a title in HTML) or label (called an anchor in HTML), as well as formatting specifications. Default values for align
, digits
, and display
are class dependent.
The available method functions for xtable
are given by methods(xtable)
. Users can extend the list of available classes by writing methods for the generic function xtable
. These methods functions should have x
as their first argument with additional arguments to specify caption
, label
, align
, digits
, and display
. Optionally, other arguments may be present to specify how the object x
should be manipulated. All method functions should return an object whose class if given by c("xtable","data.frame")
. The resulting object can have attributes caption and label, but must have attributes align, digits, and display. It is strongly recommended that you set these attributes through the provided replacement functions as they perform validity checks.
The xtable package is a creation of David Dahl with contributions and suggestions from many others.