PugFanatic
PugFanatic

Reputation: 31

Change .Rmd file to .md file

How do I change an .Rmd file to an .md file, that I can then push to GitHub? I have knit to HTML

Is it possible to do this by something as simple as changing the file extension to ".md" and doing a save as? Any insight into what the differences are amongst these types of files would be so helpful!

Also, how different should an .Rmd and .md file look when opened?

Thank you!

Upvotes: 0

Views: 3923

Answers (2)

Ben Bolker
Ben Bolker

Reputation: 226192

You can use

knitr::knit("my_file.Rmd")

which should output my_file.md (a Markdown file with included code chunks) and generate figures (in a figs/ directory, I think, not sure).

Upvotes: 1

Kevin Arseneau
Kevin Arseneau

Reputation: 6264

You can add keep_md to your YAML header.

---
output: 
  html_document:
    keep_md: true
---

Just be aware you will need to also push any related assets to Github as well as the .md file

Upvotes: 1

Related Questions