Description Usage Arguments Details Value Author(s) See Also Examples
For an object of class "xtableMatharray"
, returns the LaTeX
commands to produce an array.
1 2 3 4 5 6 7 8 |
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.) |
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.
A character vector containing the LaTeX code for incorporating an array in a mathematical expression.
David Scott d.scott@auckland.ac.nz.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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")
|
\begin{array}{rrr}
1.14E-03 & 3.01E-05 & 7.33E-05 \\
3.01E-05 & 3.32E-04 & -5.28E-05 \\
7.33E-05 & -5.28E-05 & 3.52E-04 \\
\end{array}
[1] "xtableMatharray"
Classes 'xtableMatharray', 'xtable' and 'data.frame': 3 obs. of 3 variables:
$ 1: num 1.14e-03 3.01e-05 7.33e-05
$ 2: num 3.01e-05 3.32e-04 -5.28e-05
$ 3: num 7.33e-05 -5.28e-05 3.52e-04
- attr(*, "align")= chr "r" "r" "r" "r"
- attr(*, "digits")= num 0 2 2 2
- attr(*, "display")= chr "s" "f" "f" "f"
\begin{array}{rrr}
0.00 & 0.00 & 0.00 \\
0.00 & 0.00 & -0.00 \\
0.00 & -0.00 & 0.00 \\
\end{array}
Classes 'xtableMatharray', 'xtable' and 'data.frame': 3 obs. of 3 variables:
$ 1: num 1.14e-03 3.01e-05 7.33e-05
$ 2: num 3.01e-05 3.32e-04 -5.28e-05
$ 3: num 7.33e-05 -5.28e-05 3.52e-04
- attr(*, "align")= chr "r" "r" "r" "r"
- attr(*, "digits")= num 0 2 2 2
- attr(*, "display")= chr "E" "E" "E" "E"
\begin{array}{rrr}
1.14E-03 & 3.01E-05 & 7.33E-05 \\
3.01E-05 & 3.32E-04 & -5.28E-05 \\
7.33E-05 & -5.28E-05 & 3.52E-04 \\
\end{array}
Classes 'xtableMatharray', 'xtable' and 'data.frame': 3 obs. of 3 variables:
$ 1: num 1.14e-03 3.01e-05 7.33e-05
$ 2: num 3.01e-05 3.32e-04 -5.28e-05
$ 3: num 7.33e-05 -5.28e-05 3.52e-04
- attr(*, "align")= chr "r" "r" "r" "r"
- attr(*, "digits")= num 6 6 6 6
- attr(*, "display")= chr "s" "f" "f" "f"
\begin{array}{rrr}
0.001140 & 0.000030 & 0.000073 \\
0.000030 & 0.000332 & -0.000053 \\
0.000073 & -0.000053 & 0.000352 \\
\end{array}
Classes 'xtableMatharray', 'xtable' and 'data.frame': 3 obs. of 3 variables:
$ 1: num 1.14e-03 3.01e-05 7.33e-05
$ 2: num 3.01e-05 3.32e-04 -5.28e-05
$ 3: num 7.33e-05 -5.28e-05 3.52e-04
- attr(*, "align")= chr "r" "r" "r" "r"
- attr(*, "digits")= num 6 6 6 6
- attr(*, "display")= chr "s" "f" "f" "f"
\begin{array}{rrr}
0,001140 & 0,000030 & 0,000073 \\
0,000030 & 0,000332 & -0,000053 \\
0,000073 & -0,000053 & 0,000352 \\
\end{array}
\scalebox{0.5}{
\begin{array}{rrr}
0.001140 & 0.000030 & 0.000073 \\
0.000030 & 0.000332 & -0.000053 \\
0.000073 & -0.000053 & 0.000352 \\
\end{array}
}
% latex table generated in R 3.4.4 by xtable 1.8-4 package
\begin{array}{rrr}
0.001140 & 0.000030 & 0.000073 \\
0.000030 & 0.000332 & -0.000053 \\
0.000073 & -0.000053 & 0.000352 \\
\end{array}
\begin{array}{rrr}
0.001140 & 0.000030 & 0.000073 \\
0.000030 & 0.000332 & -0.000053 \\
0.000073 & -0.000053 & 0.000352 \\
\end{array}
% latex table generated in R 3.4.4 by xtable 1.8-4 package
% 2000-01-01
\begin{array}{rrr}
0.001140 & 0.000030 & 0.000073 \\
0.000030 & 0.000332 & -0.000053 \\
0.000073 & -0.000053 & 0.000352 \\
\end{array}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.