Difference between R MarkDown and R NoteBook

后端 未结 8 1757
时光说笑
时光说笑 2021-01-29 20:01

I am trying to understand at a high level what the differences between R Markdown and R NoteBook. I know they are interrelated but I would like to figu

8条回答
  •  青春惊慌失措
    2021-01-29 20:39

    From jrnold:

    R notebook files show the output inside the editor, while hiding the console. R markdown files shows the output inside the console, and does not show output inside the editor. They differ in the value of output in their YAML headers.
    The YAML header for the R notebook will have the line,

    ---
    ouptut: html_notebook
    ---
    

    The YAML header for the R markdown file will have the line,

    ouptut: html_document
    

    Copying the YAML header from an R notebook to a R markdown file changes it to an R markdown file, and vice-versa. More specifically, changing the value of output to This is because the RStudio IDE when opening and the rmarkdown package when knitting uses the YAML header of a file, and in particular the value of the output key in the YAML header, to determine what type of document it is.

提交回复
热议问题