I am trying to put a table in the first page of the appendix in R Markdown as per:
\newpage
# References {-}
<div id="refs"></div>
\newpage
# Appendix {-}
\setcounter{table}{0}
\renewcommand{\thetable}{A\arabic{table}}
```{r pre_table_appendix, message=FALSE, warning=FALSE, echo=FALSE, include=FALSE, fig.pos="H"}
tab <- matrix(c("text1", "text2", "text3", "text4",
"text1", "text2", "text3", "text4",
"text1", "text2", "text3", "text4",
"text1", "text2", "text3", "text4"), ncol=4, byrow=TRUE)
colnames(tab) <- c('Variable','Variable','Variable','Variable')
rownames(tab) <- NULL
tab <- as.table(tab)
table_appendix <- kbl(tab, longtable = T, booktabs = T, row.names = 0, caption = "Title.") %>%
kable_styling(latex_options = c("repeat_header"))
```
\begin{landscape}
```{r table_appendix_f, echo=FALSE}
table_appendix
```
\end{landscape}
However because my table_appendix is in landscape I end up with one blank page with just "Appendix" and then another page with the actual table. Anyone knows how to put the table together with Appendix?

