You can use the add.to.row
parameter
library(xtable)
df <- data.frame(qwertz=c("a","b","c","d","e","f"), asdfg=c("a","b"))
df <- t(df)
n <- nrow(df)
print(xtable(df), hline.after = NULL,
include.colnames = FALSE,
add.to.row = list(pos = list(0, 1, n),
command = c('\\toprule[1.5pt]\n', '\\midrule[1pt]\n', '\\bottomrule[1.5pt]\n')))
## % latex table generated in R 3.0.2 by xtable 1.7-1 package
## % Sat Jan 25 14:32:34 2014
## \begin{table}[ht]
## \centering
## \begin{tabular}{rllllll}
## \toprule[1.5pt]
## qwertz & a & b & c & d & e & f \\
## \midrule[1pt]
## asdfg & a & b & a & b & a & b \\
## \bottomrule[1.5pt]
## \end{tabular}
## \end{table}
To use it with longtable
LaTeX environment you can do something like this
print(xtable(df),
tabular.environment = "longtable",
floating = FALSE,
hline.after = NULL,
include.colnames = FALSE,
booktabs = TRUE,
add.to.row = list(pos = list(0, 1, n),
command = c('\\toprule[1.5pt]\n', '\\midrule[1pt]\n', '\\bottomrule[1.5pt]\n')))
## % latex table generated in R 3.0.2 by xtable 1.7-1 package
## % Mon Jan 27 13:00:01 2014
## \begin{longtable}{rllllll}
## \toprule[1.5pt]
## qwertz & a & b & c & d & e & f \\
## \midrule[1pt]
## asdfg & a & b & a & b & a & b \\
## \bottomrule[1.5pt]
## \end{longtable}