sanitize.text.function),\r
sanitize.colnames.function = getOption("xtable.sanitize.colnames.function",\r
sanitize.text.function),\r
+ sanitize.subheadings.function =\r
+ getOption("xtable.sanitize.subheadings.function",\r
+ sanitize.text.function),\r
+ sanitize.message.function =\r
+ getOption("xtable.sanitize.message.function",\r
+ sanitize.text.function),\r
math.style.negative = getOption("xtable.math.style.negative", FALSE),\r
html.table.attributes = getOption("xtable.html.table.attributes", "border=1"),\r
print.results = getOption("xtable.print.results", TRUE),\r
mRule <- "\\hline"\r
bRule <- "\\hline"\r
}\r
+ ## Sanitize subheadings if required\r
+ if (!is.null(sanitize.subheadings.function)) {\r
+ for (i in 1:length(x)){\r
+ attr(x[[i]], 'subheading') <-\r
+ sanitize.subheadings.function(attr(x[[i]], 'subheading'))\r
+ }\r
+ }\r
+ ## Sanitize message if required\r
+ if (!is.null(sanitize.message.function)) {\r
+ xMessage <- attr(x, 'message')\r
+ xMessage <- sapply(xMessage, sanitize.message.function)\r
+ attr(x, 'message') <- xMessage\r
+ } \r
if (colnames.format == "single"){\r
+ \r
add.to.row <- list(pos = NULL, command = NULL)\r
add.to.row$pos <- as.list(c(0, combinedRowNums[-length(x)],\r
dim(combined)[1]))\r
print.xtableList(xList1, booktabs = TRUE)\r
@ %def\r
\r
-Row and column names can be sanitized.\r
+Row and column names, subheadings, and the message can be sanitized.\r
\r
<<sanitize>>=\r
large <- function(x){\r
italic <- function(x){\r
paste0('{\\emph{ ', x, '}}')\r
}\r
+bold <- function(x){\r
+ paste0('{\\bfseries ', x, '}')\r
+}\r
+red <- function(x){\r
+ paste0('{\\color{red} ', x, '}')\r
+}\r
@ %def\r
\r
\r
print.xtableList(xList,\r
sanitize.rownames.function = italic,\r
sanitize.colnames.function = large,\r
+ sanitize.subheadings.function = bold,\r
+ sanitize.message.function = red,\r
booktabs = TRUE)\r
@ %def\r
\r
print.xtableList(xList, colnames.format = "multiple",\r
sanitize.rownames.function = italic,\r
sanitize.colnames.function = large,\r
+ sanitize.subheadings.function = bold,\r
+ sanitize.message.function = red, \r
booktabs = TRUE)\r
@ %def\r
\r