I'm trying to create various slides in xaringan
presentation using the option results='assis'
of knitr, but it doesn't work.
I have use the following code:
---
title: "Presentation"
author: ""
date: ""
output:
xaringan::moon_reader:
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
```{r, results='asis'}
for (i in 1:3) {
cat("---", "\n")
cat("## Slide", i, "\n")
cat("Hello", i)
cat("\n")
}
'''
I expect the output to be 3 pages, but the actual output is one page. I have also tried asis_output
instead of cat
.