print.xtableMatharray {xtable} | R Documentation |
Print Math Array
Description
For an object of class "xtableMatharray"
, returns the LaTeX
commands to produce an array.
Usage
## S3 method for class 'xtableMatharray'
print(x,
print.results = TRUE,
format.args = getOption("xtable.format.args", NULL),
scalebox = getOption("xtable.scalebox", NULL),
comment = FALSE,
timestamp = NULL,
...)
Arguments
x |
An object of class |
print.results |
If |
format.args |
List of arguments for the |
scalebox |
If not |
comment |
If |
timestamp |
Timestamp to include in LaTeX comment. Set this
to |
... |
Additional arguments. (Currently ignored.) |
Details
This command prints an array of numbers which may be included in a
mathematical expression in a LaTeX document created using Sweave
or knitr. Internally it calls print.data.frame
but with
special values for the arguments, namely that the tabular environment
is array
, row names and column names are not included, and there
are no horizontal lines. Note that the default values for the arguments
comment
and timestamp
are different to the default values
for print.xtable
, the justification being that comments would
make the resulting LaTeX harder to read.
Value
A character vector containing the LaTeX code for incorporating an array in a mathematical expression.
Author(s)
David Scott d.scott@auckland.ac.nz.
See Also
Examples
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)
### Simple test of print.xtableMatharray
print.xtableMatharray(xtable(V, display = rep("E", 4)))
class(V) <- c("xtableMatharray")
class(V)
### Test without any additional arguments
mth <- xtableMatharray(V)
str(mth)
print(mth)
### Test with arguments to xtable
mth <- xtableMatharray(V, display = rep("E", 4))
str(mth)
print(mth)
mth <- xtableMatharray(V, digits = 6)
str(mth)
print(mth)
### Test with additional print.xtableMatharray arguments
mth <- xtableMatharray(V, digits = 6)
str(mth)
print(mth, format.args = list(decimal.mark = ","))
print(mth, scalebox = 0.5)
print(mth, comment = TRUE)
print(mth, timestamp = "2000-01-01")
print(mth, comment = TRUE, timestamp = "2000-01-01")