R Under development (unstable) (2026-02-18 r89435 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > require(xtable) Loading required package: xtable > 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))) \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} > > class(V) <- c("xtableMatharray") > class(V) [1] "xtableMatharray" > > ### Test without any additional arguments > mth <- xtableMatharray(V) > str(mth) 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 [1:4] "r" "r" "r" "r" - attr(*, "digits")= num [1:4] 0 2 2 2 - attr(*, "display")= chr [1:4] "s" "f" "f" "f" > print(mth) \begin{array}{rrr} 0.00 & 0.00 & 0.00 \\ 0.00 & 0.00 & -0.00 \\ 0.00 & -0.00 & 0.00 \\ \end{array} > > ### Test with arguments to xtable > mth <- xtableMatharray(V, display = rep("E", 4)) > str(mth) 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 [1:4] "r" "r" "r" "r" - attr(*, "digits")= num [1:4] 0 2 2 2 - attr(*, "display")= chr [1:4] "E" "E" "E" "E" > print(mth) \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} > > mth <- xtableMatharray(V, digits = 6) > str(mth) 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 [1:4] "r" "r" "r" "r" - attr(*, "digits")= num [1:4] 6 6 6 6 - attr(*, "display")= chr [1:4] "s" "f" "f" "f" > print(mth) \begin{array}{rrr} 0.001140 & 0.000030 & 0.000073 \\ 0.000030 & 0.000332 & -0.000053 \\ 0.000073 & -0.000053 & 0.000352 \\ \end{array} > > ### Test with additional print.xtableMatharray arguments > mth <- xtableMatharray(V, digits = 6) > str(mth) 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 [1:4] "r" "r" "r" "r" - attr(*, "digits")= num [1:4] 6 6 6 6 - attr(*, "display")= chr [1:4] "s" "f" "f" "f" > print(mth, format.args = list(decimal.mark = ",")) \begin{array}{rrr} 0,001140 & 0,000030 & 0,000073 \\ 0,000030 & 0,000332 & -0,000053 \\ 0,000073 & -0,000053 & 0,000352 \\ \end{array} > print(mth, scalebox = 0.5) \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} } > print(mth, comment = TRUE) % latex table generated in R 4.6.0 by xtable 1.8-8 package \begin{array}{rrr} 0.001140 & 0.000030 & 0.000073 \\ 0.000030 & 0.000332 & -0.000053 \\ 0.000073 & -0.000053 & 0.000352 \\ \end{array} > print(mth, timestamp = "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} > print(mth, comment = TRUE, timestamp = "2000-01-01") % latex table generated in R 4.6.0 by xtable 1.8-8 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} > > > > > > > proc.time() user system elapsed 0.21 0.12 0.32