pass additional arguments such as "big.marks" to "formatC()".
* Added "short.caption" argument to "print" to let the user
specify a Latex short caption used when creating a list of tables.
+ * Added "rotate.colnames" and "rotate.rownames" arguments to
+ "print.xtable".
* Added an "is.null()" check on the "table.placement" argument.
* Put in some changes from John Leonard regarding the placement
of newlines when "longtable" and "add.to.row" are used together.
print.results=TRUE,\r
format.args=NULL,\r
short.caption=NULL,\r
+ rotate.rownames=FALSE,\r
+ rotate.colnames=FALSE,\r
...) {\r
# Claudio Agostinelli <claudio@unive.it> dated 2006-07-28 hline.after\r
# By default it print an \hline before and after the columns names independently they are printed or not and at the end of the table\r
# Claudio Agostinelli <claudio@unive.it> dated 2006-07-28 include.colnames, include.rownames \r
if (include.colnames) {\r
result <- result + BROW + BTH\r
- if (include.rownames) result <- result + STH\r
- if (is.null(sanitize.colnames.function)) { # David G. Whiting in e-mail 2007-10-09\r
- result <- result + paste(sanitize(names(x)),collapse=STH)\r
- } else {\r
- result <- result + paste(sanitize.colnames.function(names(x)), collapse=STH) # David G. Whiting in e-mail 2007-10-09\r
- }\r
+ if (include.rownames) {\r
+ result <- result + STH\r
+ } \r
+ # David G. Whiting in e-mail 2007-10-09\r
+ if (is.null(sanitize.colnames.function)) { \r
+ CNAMES <- sanitize(names(x))\r
+ } else {\r
+ CNAMES <- sanitize.colnames.function(names(x))\r
+ }\r
+ if (rotate.colnames) {\r
+ #added by Markus Loecher, 2009-11-16\r
+ CNAMES <- paste("\\begin{sideways}", CNAMES, "\\end{sideways}")\r
+ } \r
+ result <- result + paste(CNAMES, collapse=STH)\r
+\r
result <- result + ETH + EROW\r
}\r
\r
cols <- matrix("",nrow=nrow(x),ncol=ncol(x)+pos)\r
if (include.rownames) {\r
- if (is.null(sanitize.rownames.function)) { # David G. Whiting in e-mail 2007-10-09\r
- cols[,1] <- sanitize(row.names(x))\r
+ # David G. Whiting in e-mail 2007-10-09\r
+ if (is.null(sanitize.rownames.function)) { \r
+ RNAMES <- sanitize(row.names(x))\r
} else {\r
- cols[,1] <- sanitize.rownames.function(row.names(x)) # David G. Whiting in e-mail 2007-10-09\r
+ RNAMES <- sanitize.rownames.function(row.names(x)) \r
}\r
+ if (rotate.rownames) {\r
+ #added by Markus Loecher, 2009-11-16\r
+ RNAMES <- paste("\\begin{sideways}", RNAMES, "\\end{sideways}")\r
+ } \r
+ cols[,1] <- RNAMES\r
}\r
\r
## Begin vectorizing the formatting code by Ian Fellows [ian@fellstat.com]\r
print((tli.table),include.colnames=FALSE,include.rownames=FALSE,floating=FALSE)
@
+\subsection{Rotate row and column names}
+The {\tt rotate.rownames } and {\tt rotate.colnames} arguments can be
+used to rotate the row and/or column names.
+
+<<results=tex>>=
+print((tli.table),rotate.rownames=TRUE,rotate.colnames=TRUE)
+@
+
\subsection{Horizontal lines}
<<results=tex>>=
print(xtable(anova(glm.D93)),hline.after=c(1),floating=FALSE)
html.table.attributes="border=1",
print.results=TRUE,
format.args=NULL,
- short.caption=NULL, ...)}
+ short.caption=NULL,
+ rotate.rownames = FALSE,
+ rotate.colnames = FALSE,
+ ...)}
\arguments{
\item{x}{An object of class \code{"xtable"}.}
\item{type}{Type of table to produce. Possible values for \code{type} are \code{"latex"} or \code{"html"}.
\item{print.results}{If \code{TRUE}, the generated table is printed to standard output. Set this to \code{FALSE} if you will just be using the character vector that is returned invisibly.}
\item{format.args}{List of arguments for the \code{formatC} function. For example, standard German number separators can be specified as \code{format.args=list(big.mark = "'", decimal.mark = ","))}.}
\item{short.caption}{A "short caption" can be specified that gets used as the table descriptor when LaTeX generates a "List of Tables".}
+ \item{rotate.rownames}{If \code{TRUE}, the row names are displayed vertically in LaTeX.}
+ \item{rotate.colnames}{If \code{TRUE}, the column names are displayed vertically in LaTeX.}
\item{...}{Additional arguments. (Currently ignored.)}
}
\details{