X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=pkg%2Ftests%2Ftest.matharray.R;h=3f51aa288281aa6c565ee5d027b2a8930f08f955;hb=795ae3b2b096c3e812d84f7eab3c83cc9a68f0cd;hp=fed6f85aa063a8a02b9c2ee3c19f15da20e2471f;hpb=41668fa2a665c2b0945c3455dc3b6b8b087e92e9;p=xtable.git diff --git a/pkg/tests/test.matharray.R b/pkg/tests/test.matharray.R index fed6f85..3f51aa2 100644 --- a/pkg/tests/test.matharray.R +++ b/pkg/tests/test.matharray.R @@ -2,39 +2,36 @@ require(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) -V +### 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 <- xtable(V) str(mth) -mth - -tbl <- xtable(V, display = rep("E", 4)) -str(tbl) -tbl +print(mth) -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) -V +### Test with arguments to xtable mth <- xtable(V, display = rep("E", 4)) -class(mth) -mth -class(mth) <- c("xtableMatharray") -mth +str(mth) print(mth) -print.xtableMatharray(xtable(V, display = rep("E", 4))) -class(mth) <- c("xtableMatharray") -mth -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) -V +mth <- xtable(V, digits = 6) +str(mth) +print(mth) + +### Test with additional print.xtableMatharray arguments +mth <- xtable(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") + + + -print.xtableMatharray(xtable(V), - format.args = list(display = rep("E", 4))) -print.xtableMatharray(xtable(V), - format.args = list(digits = 6))