我有一个.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")
```