我有一个 .rmd
文件名为 mycode.rmd
保存在名为 root/scripts
的子目录中在 github .
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
时从 RStudio 按下“knit to HTML”。 .更新 :
基于@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")
```
最佳答案
基于@Thomas 评论的解决方案:
这是一种选择:
```{r, include=FALSE}
# add this chunk to end of mycode.rmd
file.rename(from="scripts/mycode.md",
to="README.md")
```
关于r - 将 .rmd 文件编织为 .md 并使用不同的名称将 .md 文件上一级保存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19989325/