0

所以我有基本的模板,带有用于 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)
4

1 回答 1

1

通过将 YAML 更改为:

---
title: "Untitled"
author: "MS"
date: "30 10 2019"
output:
  ioslides_presentation: default
  html_document: null
---

希望这对你有帮助。

于 2019-10-30T17:16:24.423 回答