I am trying to use the xtable package to create a print-quality half matrix in R. I can create the full symetric matrix with no problem but when I extract only the lower triangle matrix, I get the error shown below.
library(Matrix)
datamat1<-tril(data1) #extract lower triangle
library(xtable)
options(xtable.floating = FALSE)
options(xtable.timestamp = "")
xtable(datamat1, digits = 3)
The error that I get is: "no applicable method for 'xtable' applied to an object of class "c('dtrMatrix', 'ddenseMatrix', 'triangularMatrix', 'dMatrix', 'denseMatrix', 'Matrix', 'xMatrix', 'mMatrix', 'Mnumeric', 'replValueSp')"
I know that converting the matrix to a half matrix also converts its class to dtrMatrix but there must be some way to export a lower triangle matrix in a publishable quality form. I have also tried using the 'zoo' package but without any luck. How can this be done.
