]> git.donarmstrong.com Git - xtable.git/commitdiff
Fixed alignment of column headings in xtableList, with multiple and
authordscott <dscott@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Wed, 6 Jan 2016 23:34:03 +0000 (23:34 +0000)
committerdscott <dscott@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Wed, 6 Jan 2016 23:34:03 +0000 (23:34 +0000)
include.rownmes TRUE

git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@82 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/R/xtableList.R

index 35736f0682fbe66896fe4b5bc31ac2951af758c3..f0fb6d6a1da82a083539335bf02b04ebd5629a67 100644 (file)
@@ -105,6 +105,7 @@ print.xtableList <- function(x,
     include.colnames <- TRUE\r
   }\r
 \r
+  ## Create headings for columns if multiple headings are needed\r
   if (colnames.format == "multiple"){\r
     if (is.null(sanitize.colnames.function)) {\r
       colHead <- names(x[[1]])\r
@@ -115,6 +116,9 @@ print.xtableList <- function(x,
       colHead <- paste("\\begin{sideways}", colHead, "\\end{sideways}")\r
     }\r
     colHead <- paste0(colHead, collapse = " & ")\r
+    if (include.rownames) {\r
+      colHead <- paste0(" & ", colHead)\r
+    }\r
     colHead <- paste0(tRule, "\n", colHead, " \\\\", mRule, "\n")\r
     add.to.row <- list(pos = NULL, command = NULL)\r
     add.to.row$pos <- as.list(c(0, c(combinedRowNums[1:length(x)])))\r