6
我有一個.rmd
文件,名爲mycode.rmd
,保存在名爲root/scripts
的子目錄github上。將.rmd文件編織爲.md並將.md文件另存爲一級別
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按'編織爲HTML'。
更新:
根據意見從@Thomas A液:
Here is one option:
```{r, include=FALSE}
# add this chunk to end of mycode.rmd
file.rename(from="scripts/mycode.md",
to="README.md")
```
雖然不是在'knit'之後用'file.rename'移動它? – Thomas
...或指定一個目錄級別的輸出文件路徑? – Thomas
現在查看file.rename。你能爲knitr指定一個輸出文件路徑,它將控制編織到html時md文件的保存位置嗎?我以爲你只能指定圖形路徑。 –