}
-## data.frame and matrix objects
+### data.frame and matrix objects
xtable.data.frame <- function(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, auto = FALSE,
digits = NULL, display = NULL, auto = FALSE, ...) {
return(xtable.data.frame(data.frame(x, check.names = FALSE),
caption = caption, label = label, align = align,
- digits = digits, display = display, auto = auto))
+ digits = digits, display = display, auto = auto,
+ ...))
}
+### xtableMatharray object
+### To deal with numeric arrays such as a variance-covariance matrix
+### From a request by James Curran, 16 October 2015
+xtable.xtableMatharray <- function(x, caption = NULL, label = NULL,
+ align = NULL, digits = NULL,
+ display = NULL, auto = FALSE,
+ ...) {
+ class(x) <- c("xtableMatharray","matrix")
+ xtbl <- xtable.matrix(x,
+ caption = caption, label = label, align = align,
+ digits = digits, display = display, auto = auto,
+ ...)
+ class(xtbl) <- c("xtableMatharray","xtable","data.frame")
+ return(xtbl)
+}
### table objects (of 1 or 2 dimensions) by Guido Gay, 9 Feb 2007
### Fixed to pass R checks by DBD, 9 May 2007
}
-## anova objects
+### anova objects
xtable.anova <- function(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, auto = FALSE, ...) {
}
-## aov objects
+### aov objects
xtable.aov <- function(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, auto = FALSE, ...) {
-## lm objects
+### lm objects
xtable.lm <- function(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, auto = FALSE, ...) {
}
-## glm objects
+### glm objects
xtable.glm <- function(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, auto = FALSE, ...) {
}
-## prcomp objects
+### prcomp objects
xtable.prcomp <- function(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, auto = FALSE, ...) {
tmp <- cbind(beta, exp(beta), se, beta/se, 1 - pchisq((beta/se)^2, 1))
dimnames(tmp) <- list(names(beta),
c("coef", "exp(coef)", "se(coef)", "z", "p"))
- }
- else {
+ } else {
tmp <- cbind( beta, exp(beta), se, beta/se,
signif(1 - pchisq((beta/se)^2, 1), digits - 1))
dimnames(tmp) <- list(names(beta),
"Arg8", "Arg9", "Arg10", "Arg11",
paste(tp.1, month.abb[tp.2], sep = " "))
tmp <- data.frame(x, row.names = ROWNAMES);
- }
- else if (inherits(x, "ts") && is.null(ncol(x))) {
+ } else if (inherits(x, "ts") && is.null(ncol(x))) {
COLNAMES <- switch(frequency(x),
"Value",
"Arg2", "Arg3", # Dummy arguments