Paste the .rmd file into .md and save the .md file one level with a different name

I have a .rmd file called mycode.rmd saved in the root/scripts subdirectory 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 ``` 

Thus, the README.md in the root folder will always be updated with my "real" .rmd file in root/scripts . The most that I want to make this happen is to click "knit in HTML" from RStudio while working on mycode.rmd .

enter image description here

Update :

Solution based on @Thomas comments:

 Here is one option: ```{r, include=FALSE} # add this chunk to end of mycode.rmd file.rename(from="scripts/mycode.md", to="README.md") ``` 
+6
source share
1 answer

Solution based on @Thomas comments:

Here is one of the options:

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

Source: https://habr.com/ru/post/958108/


All Articles