我如何在 RStudio 上像这样渲染 R-Presentation (ioslide)?

问题描述

告诉我如何像这样渲染 R-Presentation。我在阅读以学习如何制作 R-Presentation 时看到了许多示例,但是每次我像平常一样在 R code 上运行 RStudio 时,它们拒绝呈现,尽管如果我 ctr + v显示封面。像这样我的 MWE,我知道这不是一个单一的幻灯片演示,但我得到的只是

enter image description here

---
title: "Habits"
author: John Doe
date: march 22,2005
output: ioslides_presentation
---

# In the morning

## Getting up

- Turn off alarm
- Get out of bed

## Breakfast

- Eat eggs
- Drink coffee

# In the evening

## Dinner

- Eat spaghetti
- Drink wine

---

```{r,cars,fig.cap="A scatterplot.",echo=FALSE}
plot(cars)
```

## Going to sleep

- Get in bed
- Count sheep

请向我展示在 keyboard shortcut 上呈现 R-PresentationRStudio,或在 bottom 本身上将 click 呈现为 RStudio。>

this

解决方法

这需要 .Rpres 文件类型而不是 .Rmd(Rmarkdown)。

  1. 在 Rstudio 中打开一个新的文本文件

  2. 另存为 file.Rpres

  3. 使用适当的语法让 RStudio 知道如何呈现您的演示文稿

    In the morning
    =====================
    Exercise
    
    Breakfast
    =====================
    - Cereal
    

当您保存带有代码的文件时,Rstudio 将在通常的 preview 按钮所在的位置有一个 knit 按钮。当您点击 preview 时,Rstudio 将适当地呈现文件。

enter image description here 我使用 this link 进行研究