I wonder if there is a way to make some hlines in xtable dashed or dotted using command hline.after
. I couldn't find a solution.
MWE (Rnw):
\documentclass{article}
\usepackage{booktabs}
\begin{document}
<<mytable, results='asis', echo=F>>=
library("xtable")
print(xtable(matrix(rnorm(32), 8,4), align="lllll"), booktabs=T, hline.after = c(-1,0,4,8))
@
\end{document}
gives this latex table code:
\begin{table}[ht]
\centering
\begin{tabular}{lllll}
\toprule
& 1 & 2 & 3 & 4 \\
\midrule
1 & 0.50 & -0.49 & -1.32 & -0.29 \\
2 & 1.01 & 0.57 & 1.35 & 0.54 \\
3 & -1.20 & 1.02 & 1.12 & 0.07 \\
4 & 0.04 & 0.14 & 0.23 & -0.38 \\
\midrule
5 & -1.71 & -0.90 & 0.59 & -0.05 \\
6 & 0.14 & -0.82 & -0.44 & 0.52 \\
7 & -0.28 & 1.91 & -1.80 & 0.53 \\
8 & 0.38 & 2.66 & 0.26 & -1.38 \\
\bottomrule
\end{tabular}
\end{table}
Instead of the solid \midrule
after line 4, I'd like a dashed or, preferably, dotted line.
I know, in latex dashed horizontal lines can me made using arydshln package, also dotted hlines are possible manipulating \dashlinedash{}, \dashlinegap{} and \arrayrulewidth{}.
But how can I make dotted/dashed lines when printing an xtable? Does anyone have a solution?