I have a .rmd
file called mycode.rmd
saved in a subdirectory called root/scripts
on 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
```
This way README.md
in the root folder will always be up to date with my 'real' .rmd
file in root/scripts
. The most I want to do to make this happen is press 'knit to HTML' from RStudio when working on mycode.rmd
.
Update:
A solution based on comments from @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")
```
A solution based on comments from @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")
```
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With