I generated a few tables in R Markdown out of data frames using kable
, the tables are too big for the portrait page. So I'm trying to change the portrait side to a landscape side in the knitted pdf. The problem is, that it only works for me if there is no caption or footnotes in the tables. Is there an easy way to change this?
In the code, I show you everything I tried up to now.
header-includes:
\usepackage{pdflscape}
\usepackage{lscape}
\usepackage{rotating}
\begingroup
\begin{landscape}
\begin{sidewaystable}
```{r comment='1', echo=FALSE, results='asis',}
load(file = "Data/VPNCondition.RData")
kable(VPNCondition, format="latex",booktabs=TRUE,
caption="Distribution of subjects between conditions and trials") %>%
kableExtra::landscape() %>%
footnote(general=c('This table shows the breakdown of the experimental groups.',
'These subjects were able to survive all claims and exclusion criteria of the pre-analysis',
'and preparation of the data and are included in the data analysis.')) %>%
kable_styling(bootstrap_options="basic", font_size=14, full_width=FALSE,
latex_options=c("scale_down"))
```
\endgroup
\end{landscape}
\end{sidewaystable}