EVOLUTION-MANAGER
Edit File: autoformat.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Automatically Format Export Tables</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for autoformat {xtable}"><tr><td>autoformat {xtable}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Automatically Format Export Tables</h2> <h3>Description</h3> <p>Suggest an appropriate alignment, number of digits, and display type for <code>xtable</code>. </p> <h3>Usage</h3> <pre> autoformat(xtab, zap = getOption("digits")) xalign(x, pad = TRUE) xdigits(x, pad = TRUE, zap = getOption("digits")) xdisplay(x, pad = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>xtab</code></td> <td> <p>an object of class <code>xtable</code>.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>a vector, matrix, or data frame.</p> </td></tr> <tr valign="top"><td><code>pad</code></td> <td> <p>whether to format row names, when <code>x</code> is two-dimensional.</p> </td></tr> <tr valign="top"><td><code>zap</code></td> <td> <p>the number of digits passed to <code>zapsmall</code>.</p> </td></tr> </table> <h3>Value</h3> <p><code>autoformat</code> returns a copy of <code>xtab</code>, after applying <code>xalign</code>, <code>xdigits</code>, and <code>xdisplay</code>. </p> <p><code>xalign</code> returns a character vector consisting of <code>"l"</code> and <code>"r"</code> elements, for left/right alignment. </p> <p><code>xdigits</code> returns an integer vector. </p> <p><code>xdisplay</code> returns a character vector of <code>"d"</code>, <code>"f"</code>, and <code>"s"</code> elements, for integer/double/string display. </p> <h3>Author(s)</h3> <p>Arni Magnusson.</p> <h3>See Also</h3> <p><code><a href="xtable.html">xtable</a></code>, <code><a href="table.attributes.html">align</a></code>, <code><a href="table.attributes.html">digits</a></code>, <code><a href="table.attributes.html">display</a></code> </p> <h3>Examples</h3> <pre> ## 1 Vector xalign(precip) xdigits(precip) xdisplay(precip) ## 2 Data frame head(mtcars) xdigits(mtcars, pad = FALSE) xdigits(mtcars, pad = TRUE) xalign(mtcars) xdisplay(mtcars) ## 3 Autoformat when xtable is created xtable(mtcars, align = xalign(mtcars), digits = xdigits(mtcars), display = xdisplay(mtcars)) ## equivalent shortcut xtable(mtcars, auto = TRUE) ## 4 Autoformat existing xtable mt <- xtable(mtcars) align(mt) <- xalign(mt) digits(mt) <- xdigits(mt) display(mt) <- xdisplay(mt) ## equivalent shortcut mt <- autoformat(mt) </pre> <hr /><div style="text-align: center;">[Package <em>xtable</em> version 1.8-4 <a href="00Index.html">Index</a>]</div> </body></html>