I am working on a report with rmarkdown and latex. I need to print a group of tables using knitr::kable , but not print when inside a for loop.
This is my code:
--- title: "project title" author: "Mr. Author" date: "2016-08-30" output: pdf_document: latex_engine: xelatex bibliography: biblio.bib header-includes: - \usepackage{tcolorbox} --- Text and chunks that run ok. ```{r loadLibraries} require(data.table) require(knitr) ```
It doesnβt matter if I use results = "asis" or even omit it altogether, it doesn't print anything in the document .
I tried to include the kable call in the print ( print ( print(kable(t2[[i]]... ) call and it successfully prints the output in the document, but the format is the same as the standard R request format (preceded by ## , for example), which is pretty ugly .
How to display tables except manually?
### EDIT ###
Some responders redirected me to R knitr print in a loop as a duplicate answer. This is not because, as I said in the previous paragraph, it effectively prints the table, but the format is not expected. The accepted answer (and the associated github thread) really solved the problem.
source share