I am following code here to use the questionr package to generate some crosstabs in a report based on some surveys. My question is quite specific: Is there a way to combine the results that the call to map produces with some kind of newline command so that the resulting output is produced on its separate page?
---
title: "Test"
author: "Test"
date: "09/06/2021"
output: bookdown::pdf_document2
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = F, results="hide", warning=F, message=F)
library(tidyverse)
library(questionr)
library(knitr)
```
```{r}
#Make data frame
Sex<-sample(c('low', 'high'), replace=T, size=100)
Income<-sample(c('male','female'), replace=T, size=100)
Vote<-sample(c("Liberal", "Conservative"), replace=T, size=100)
weight<-rnorm(n=100)
df<-data.frame(Sex, Income, weight, Vote)
```
```{r results="asis"}
#Want Tables By These variables
demos<-c("Sex", "Income")
```
```{r results="asis"}
#Print Crosstabs
demos %>%
map(., tabs, df=df, x="Vote") %>%
kable()
```
\newpage
# Desired Output
```{r page1, results="asis"}
kable(tabs(df, x="Vote", y="Sex"))
```
\newpage
# Second Page
```{r page2, results="asis"}
kable(tabs(df, x="Vote", y="Income"))
```