简体   繁体   中英

Call Knit PDF (beamer) function from R file

Using RStudio Version 0.98.1103 I have a .Rmd file with some pre-populated markup (below).

Within RStudio I can click

Knit PDF > Knit PDF (Beamer)

and a PDF is generated. I would like to know how I can perform the same operation but within a .R file (essentially automating this process).

---
title: "Test"
author: "Test"
date: '2015-10-29'
output:
  beamer_presentation:
---

## R Markdown

This is an R Markdown presentation. 

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Code and Output

```{r}
summary(cars)
```

## Slide with Plot

```{r, echo=FALSE}
plot(cars)
```

您可以使用rmarkdown包中的render()

rmarkdown::render("your.Rmd")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM