所以我有带有 ioslides 演示参数的基本模板。现在我用 rstudio 中的 knit 按钮渲染它,但我想更改它并使用:
rmarkdown::render(input = rmd_file,
output_file = file.path(dirname(rmd_file), output_file),
output_format = "html_document",
output_dir = paste0(getwd(), "/", output_folder),
params = params,
encoding = "utf-8",
envir = new.env(parent = globalenv()))
但是输出文件看起来像简单的渲染 html,并且没有演示格式。
---
title: "Untitled"
author: "MS"
date: "30 10 2019"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
#``` (this comment is here to add stackoverflow formating only)
## R Markdown
This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
## Slide with Plot
```{r pressure}
plot(pressure)
通过将 YAML 更改为:
,我能够将其渲染到 RStudio 和浏览器中的 ioslides:---
title: "Untitled"
author: "MS"
date: "30 10 2019"
output:
ioslides_presentation: default
html_document: null
---
希望这对您有帮助。
在
rmarkdown::render
中,将output_format
参数的参数更改为“ioslides_presentation”(而不是“html_document”)。