Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

knitr Rmd to md and the YAML header

Tags:

r

knitr

I use knitr to render md from Rmd. The YAML header :output is not changed in that process. Is that inteded? After all the output of the md file is not md anymore.

As an example (please excuse the bad formatting -- I do not know how to make that work properly)

---
output:
  md_document:
    variant: markdown_github
---

# Test Document

This is a test document.

is rendered with knit(test.Rmd) into

---
output:
  md_document:
    variant: markdown_github
---

# Test Document

This is a test document.

Do I miss anything?

like image 931
Andreas Avatar asked Nov 10 '22 06:11

Andreas


1 Answers

knitr doesn't care about the header, you probably mean to use rmarkdown::render

like image 123
baptiste Avatar answered Nov 15 '22 05:11

baptiste