I created a table using R and sweave in LaTeX. Sweave example:
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
<<label=tab1, echo=FALSE, results=tex>>=
library(xtable)
employee <- c('John Doe','Peter Gynn','Jolie Hope')
salary <- c(21000, 23400, 26800)
mData <- data.frame(employee, salary)
print(xtable(mData, caption = "Salary", align="ccc"), caption.placement="top", hline.after = c(c(-1, 0), nrow(mData)), include.rownames=FALSE)
@
\end{document}
The basic structure of LaTeX tables
\begin{table}
\begin{tabular}{cc}
...
\end{tabular}
\end{table}
To save a lot of work, I use the print and xtable functions in R to create the table code in LaTeX. But now I want to add text between the \ end {tabular} and \ end {table} statements. The add.to.row argument does not help with the print function, because the instructions only fit before \ end {tabular}. How can I solve this problem?
Many thanks for your help.
source
share