7

我有一个.rmd名为保存在githubmycode.rmd上的子目录中的文件。root/scripts

R Markdown
========================================================

I'd like to find a way to 'knit to HTML' in RStudio and have the resulting .md
file save one level up in the root directory with a different name, README.md, 
so Github will display it.

```{r, results='hide'}
math <- 1 + 1
```

这种方式README.md在根文件夹中将始终与我的“真实”.rmd文件保持同步root/scripts。为了实现这一点,我最想做的就是在处理mycode.rmd.

在此处输入图像描述

更新

基于@Thomas 评论的解决方案:

Here is one option:

```{r, include=FALSE}
   # add this chunk to end of mycode.rmd
   file.rename(from="scripts/mycode.md", 
               to="README.md")
```
4

1 回答 1

5

基于@Thomas 评论的解决方案:

这是一种选择:

```{r, include=FALSE}
   # add this chunk to end of mycode.rmd
   file.rename(from="scripts/mycode.md", 
               to="README.md")
```
于 2013-12-05T21:00:08.843 回答