primer lugar, algunos datos de simulacro:
x <- sample(LETTERS, 5, replace = TRUE)
y <- sample(LETTERS, 5, replace = TRUE)
z <- table(x, y)
Ahora he aquí una solución un tanto torpe, utilizando print.xtable
's add.to.row
argumento.
comment <- list()
comment$pos <- list()
comment$pos[[1]] <- c(nrow(z))
comment$command <- c(paste("\\hline \n", # we`ll replace all default hlines with this and the ones below
"your footnote, caption or whatever. \n",
sep = ""))
print(xtable(z),
add.to.row = comment,
hline.after = c(-1, 0)) # indicates rows that will contain hlines (the last one was defined up there)
Si desea que su comentario que se presentarán los datos, utilice comment$pos[[1]] <- c(0)
en lugar de comment$pos[[1]] <- c(nrow(z))
y ajustar hline.after
en consecuencia.
Aquí está mi salida:
% latex table generated in R 2.14.1 by xtable 1.7-0 package
% Mon Feb 20 02:17:58 2012
\begin{table}[ht]
\begin{center}
\begin{tabular}{rrrrr}
\hline
& B & C & P & V \\
\hline
A & 0 & 0 & 0 & 1 \\
D & 1 & 0 & 0 & 0 \\
I & 0 & 0 & 0 & 1 \\
P & 0 & 0 & 1 & 0 \\
Z & 0 & 1 & 0 & 0 \\
\hline
your footnote, caption or whatever.
\end{tabular}
\end{center}
\end{table}
código de salida xtable (LaTeX o html), por lo que debe significar que LaTeX está poniendo 'Tabla 1:' delante de su texto de leyenda. Este es el comportamiento normal de LaTeX; Sugiero buscar allí una solución. – joran
¿Alguna idea de dónde buscar? – user702432
Intenta buscar "suprimir etiqueta de título" en tex.stackexchange.com – joran