EVOLUTION-MANAGER
Edit File: xtableMatharray.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: Create LaTeX Mathematical Array</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 xtableMatharray {xtable}"><tr><td>xtableMatharray {xtable}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Create LaTeX Mathematical Array </h2> <h3>Description</h3> <p>Convert an array of numbers or mathematical expressions into an <code>xtableMatharray</code> object so it can be printed. A convenience function to enable the printing of arrays in mathematical expressions in LaTeX. </p> <h3>Usage</h3> <pre> xtableMatharray(x, caption = NULL, label = NULL, align = NULL, digits = NULL, display = NULL, auto = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A numeric or character matrix.</p> </td></tr> <tr valign="top"><td><code>caption</code></td> <td> <p>Character vector of length 1 or 2 containing the table's caption or title. If length is 2, the second item is the "short caption" used when LaTeX generates a "List of Tables". Set to <code>NULL</code> to suppress the caption. Default value is <code>NULL</code>. Included here only for consistency with <code>xtable</code> methods. Not expected to be of use.</p> </td></tr> <tr valign="top"><td><code>label</code></td> <td> <p>Character vector of length 1 containing the LaTeX label. Set to <code>NULL</code> to suppress the label. Default value is <code>NULL</code>. </p> </td></tr> <tr valign="top"><td><code>align</code></td> <td> <p>Character vector of length equal to the number of columns of the resulting table, indicating the alignment of the corresponding columns. Also, <code>"|"</code> may be used to produce vertical lines between columns in LaTeX tables, but these are effectively ignored when considering the required length of the supplied vector. If a character vector of length one is supplied, it is split as <code>strsplit(align, "")[[1]]</code> before processing. Since the row names are printed in the first column, the length of <code>align</code> is one greater than <code>ncol(x)</code> if <code>x</code> is a <code>data.frame</code>. Use <code>"l"</code>, <code>"r"</code>, and <code>"c"</code> to denote left, right, and center alignment, respectively. Use <code>"p{3cm}"</code> etc. for a LaTeX column of the specified width. For HTML output the <code>"p"</code> alignment is interpreted as <code>"l"</code>, ignoring the width request. Default depends on the class of <code>x</code>. </p> </td></tr> <tr valign="top"><td><code>digits</code></td> <td> <p>Numeric vector of length equal to one (in which case it will be replicated as necessary) or to the number of columns of the resulting table <b>or</b> matrix of the same size as the resulting table, indicating the number of digits to display in the corresponding columns. Since the row names are printed in the first column, the length of the vector <code>digits</code> or the number of columns of the matrix <code>digits</code> is one greater than <code>ncol(x)</code> if <code>x</code> is a <code>data.frame</code>. Default depends on the class of <code>x</code>. If values of <code>digits</code> are negative, the corresponding values of <code>x</code> are displayed in scientific format with <code>abs(digits)</code> digits.</p> </td></tr> <tr valign="top"><td><code>display</code></td> <td> <p>Character vector of length equal to the number of columns of the resulting table, indicating the format for the corresponding columns. Since the row names are printed in the first column, the length of <code>display</code> is one greater than <code>ncol(x)</code> if <code>x</code> is a <code>data.frame</code>. These values are passed to the <code>formatC</code> function. Use <code>"d"</code> (for integers), <code>"f"</code>, <code>"e"</code>, <code>"E"</code>, <code>"g"</code>, <code>"G"</code>, <code>"fg"</code> (for reals), or <code>"s"</code> (for strings). <code>"f"</code> gives numbers in the usual <code>xxx.xxx</code> format; <code>"e"</code> and <code>"E"</code> give <code>n.ddde+nn</code> or <code>n.dddE+nn</code> (scientific format); <code>"g"</code> and <code>"G"</code> put <code>x[i]</code> into scientific format only if it saves space to do so. <code>"fg"</code> uses fixed format as <code>"f"</code>, but <code>digits</code> as number of <em>significant</em> digits. Note that this can lead to quite long result strings. Default depends on the class of <code>x</code>.</p> </td></tr> <tr valign="top"><td><code>auto</code></td> <td> <p>Logical, indicating whether to apply automatic format when no value is passed to <code>align</code>, <code>digits</code>, or <code>display</code>. This ‘autoformat’ (based on <code>xalign</code>, <code>xdigits</code>, and <code>xdisplay</code>) can be useful to quickly format a typical <code>matrix</code> or <code>data.frame</code>. Default value is <code>FALSE</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments. (Currently ignored.)</p> </td></tr> </table> <h3>Details</h3> <p>This function is only usable for production of LaTeX documents, not HTML. </p> <p>Creates an object of class <code>c("xtableMatharray","xtable","data.frame")</code>, to ensure that it is printed by the print method <code>print.xtableMatharray</code>. </p> <h3>Value</h3> <p>An object of class <code>c("xtableMatharray","xtable","data.frame")</code>. </p> <h3>Author(s)</h3> <p>David Scott <d.scott@auckland.ac.nz> </p> <h3>See Also</h3> <p><code><a href="print.xtableMatharray.html">print.xtableMatharray</a></code> </p> <h3>Examples</h3> <pre> V <- matrix(c(1.140380e-03, 3.010497e-05, 7.334879e-05, 3.010497e-05, 3.320683e-04, -5.284854e-05, 7.334879e-05, -5.284854e-05, 3.520928e-04), nrow = 3) mth <- xtableMatharray(V) class(mth) str(mth) unclass(mth) </pre> <hr /><div style="text-align: center;">[Package <em>xtable</em> version 1.8-4 <a href="00Index.html">Index</a>]</div> </body></html>