I have seen answers to creating side by side xtables in RMarkdown-HTML knitr, R Markdown, and xtable: xtable tables within HTML table
and how to create side by side xtables in Sweave directly R: Print two tables with xtable ()
But how about side by side xtables in Rmarkdown/Pandoc?
In my *Rmd file I have
```{r , results='asis', message=FALSE, echo=FALSE}
female.bmi <- lm(bmi ~ AGEGROUP + RACE + GEO_SPA + FPL_FIN + as.factor(year),
data=lach[lach$GENDER=='Female',] )
xtable(female.bmi, comment=FALSE, caption = 'Linear regression of BMI for females')
male.bmi <- lm(bmi ~ AGEGROUP + RACE + GEO_SPA + FPL_FIN + as.factor(year),
data=lach[lach$GENDER=='Male',] )
xtable(male.bmi, comment=FALSE, caption = 'Linear regression of BMI for males')
```
then I compile as follows:
knit('Modeling/simple.rmd', 'Modeling/simple.md') # creates md file
pandoc('Modeling/simple.md', format='latex') # LaTeX/PDF
These show up as separate tables - good! But how can I get them to display as side by side subfigures/subtables? I've tried to integrate Latex subfigure code around the {r}print(xtable)
code to no avail.