yihui / knitr

A general-purpose tool for dynamic report generation in R
https://yihui.org/knitr/
2.39k stars 879 forks source link

multiple captions for multiple tables per chunk #1253

Closed luccapavan closed 8 years ago

luccapavan commented 8 years ago

With just one kable command, knitr generates 3 tables, so i need 3 captions in the same kable argument. How I can do this?

yihui commented 8 years ago

Could you provide a minimal example?

luccapavan commented 8 years ago

I use the chunk...

library(BMR)
library(knitr)
stat <- stationarity(rdatapk2[,2:5], 4, 8)
kable(stat, caption = "Stationarity", format = "latex", booktabs = TRUE, longtable = TRUE, digits = 2, )

and the output is one table for KPSS test, another table for ADF test, and the last for Bayesian Information Criterion. Unfortunately, kable only do one caption. I need three captions for these tables.

yihui commented 8 years ago

The example is not minimal. What is BMR? It is not a package on CRAN. I don't know the data structure of stat, but the worst case is you call kable() three times with different input and captions.

luccapavan commented 8 years ago

Thanks, I use three times kable() for stas$KPSS, stats$ADF, stats$ADFlags ans works...

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.