Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert .Rmd into .md in R studio? [duplicate]

I am working on a website with Rmarkdown on gh-pages. However, in R studio you can only create new .Rmd files. This is a problem because I need to convert my .Rmd files into .md files before I push to my github repo.

Does anyone have some advice?

Thanks in advance!

like image 311
Gustavo B Paterno Avatar asked Aug 10 '15 07:08

Gustavo B Paterno


1 Answers

Since you're using RStudio, I'll refer to the documents they provide. Specifically, Markdown Documents, accessible by clicking on the question mark pull-down next to "Knit", select "Using R Markdown" which takes you to their webpage. From there, select "Formats > Markdown".

That page shows you that if you include the following in the YAML (first lines of the document, different kind of meta/markup as markdown), the output will be a .md file:

--- title: "Habits" author: John Doe date: March 22, 2005 output: md_document --- 

(The only relevant part is the output: portion.) In fact, since you mentioned gh-pages, you may (though not necessarily) want to choose the github-flavor of markdown with this instead:

--- title: "Habits" author: John Doe date: March 22, 2005 output:   md_document:     variant: markdown_github --- 

From here, click on the "Knit" button and you will get your .Rmd-to-.md conversion.

like image 154
r2evans Avatar answered Sep 20 '22 04:09

r2evans