Closed m-dz closed 8 years ago
For the caption position, see https://github.com/yihui/knitr/issues/895
For the label Sample A / Sample B
, it is not supported by kable()
by default, but you can pass it via the rownames.name
argument, e.g.
```{r, echo = FALSE, results='asis'}
set.seed(2016)
x1 = sample(letters[1:3], 1000, TRUE)
x2 = sample(letters[1:3], 1000, TRUE)
table(x1, x2, dnn = c("Sample A", "Sample B"))
cat('\n\n<!-- -->\n\n')
kable(table(x1, x2), rownames.name = "Sample A / Sample B", caption = "kable table title")
For how to properly format Github issues when you have the triple backticks, see https://github.com/yihui/knitr/blob/master/CONTRIBUTING.md
Thank you, I will give it a try!
I cannot get both printr and kable's caption option working together. This might be a bug or I am missing something simple. An example, not sure how to format it to be more readable, so a .txt and .pdf with printed .html attached: printr_test.pdf printr_test.txt
r global options, packages etc. (as text)
{r global_options, include = FALSE} knitr::opts_chunk$set(fig.width = 6, fig.height = 4, fig.path = 'Figs/', echo = TRUE, warning = FALSE, message = FALSE, cache = TRUE, tidy = FALSE, size = "small") options(width = 10000)
{r load packages, cache = FALSE} library(printr) library(knitr)
{r session, cache = FALSE} sessionInfo()
printr (labels)
printr + kable (caption, NO labels...)
something weird
When
echo = false
labels on first table, caption from second table before first.With
kable(NULL, ...)
andecho = false
this kinda looks allright...Any idea how to get them both (labels and caption) working together?