How can a landscape table be plotted in R Markdown (PDF output) without causing a page break to be inserted?
There is the function landscape
from the kableExtra package, but this forces a page break to be inserted.
Example:
The normal behaviour for tables in R Markdown is that the will float to minimise the breaking up of text.
---
output: pdf_document
---
Some Text
```{r, echo=F, warning=F}
library(kableExtra)
knitr::kable(mtcars, format = "latex", caption = "A table")
```
More Text
Landscape:
---
output: pdf_document
---
Some Text
```{r, echo=F, warning=F}
library(kableExtra)
knitr::kable(mtcars, format = "latex", booktabs = T, caption = "A table") %>%
landscape()
```
More Text