What command converts knitr R Markdown into Stack-Exchange-friendly Markdown?

前端 未结 3 1918
[愿得一人]
[愿得一人] 2020-12-30 04:20

Motivation: I often want to paste the results of a quick analysis using R Markdown into a StackExchange site. This includes the R-tag on Stack Overflow, Cro

3条回答
  •  感动是毒
    2020-12-30 04:37

    RStudio uses pandoc and so you can specify the markdown variant suitable for your needs. At the start of the .Rmd file:

    ---
    output:
      md_document:
        variant: markdown_strict+autolink_bare_uris
    ---
    

    You should then be able to copy/paste the resulting file contents into StackExchange.

    See: http://rmarkdown.rstudio.com/markdown_document_format.html#markdown-variants

提交回复
热议问题