I have a set of tables that I generate using code similar to the snippet below:
```{r tables, echo=TRUE, eval=TRUE} require(reshape2); require(pander) data("mtcars") data("AirPassengers") dta_lst <- list(mtcars, AirPassengers) for (i in 1:length(dta_lst)) { pander(melt(head(dta_lst[[i]], n = 2), varnames = c("Something"), value.name = "Something else"), caption = paste("Some table for: ", class(dta_lst[[i]]))) } ```
When I run the code, it produces the desired result (naturally, the provided example does not make sense, according to my data I am melting the data in a reasonable way):
--------------------------- variable Something else ---------- ---------------- mpg 21 mpg 21 cyl 6 cyl 6 disp 160 disp 160 hp 110 hp 110 drat 3.9 drat 3.9 wt 2.62 wt 2.875 qsec 16.46 qsec 17.02 vs 0 vs 0 am 1 am 1 gear 4 gear 4 carb 4 carb 4 --------------------------- Table: Some table for: data.frame ---------------- Something else ---------------- 112 118 ---------------- Table: Some table for: ts
When I try to knit code in Rstudio, pander tables are not displayed:

Naturally, without a loop, the pander command works just fine and generates tables that are neatly knitted into an HTML document.
source share