rmarkdown (version 0.7)

md_document: Convert to a markdown document

Description

Format for converting from R Markdown to another variant of markdown (e.g. strict markdown or github flavored markdown)

Usage

md_document(variant = "markdown_strict", preserve_yaml = FALSE,
  toc = FALSE, toc_depth = 3, fig_width = 7, fig_height = 5,
  fig_retina = NULL, dev = "png", includes = NULL, md_extensions = NULL,
  pandoc_args = NULL)

Arguments

variant
Markdown variant to produce (defaults to "markdown_strict"). Other valid values are "markdown_github", "markdown_mmd", markdown_phpextra", or even "markdown" (which produces pandoc markdown). You can also compose custom markdown variants, see the do
preserve_yaml
Preserve YAML front matter in final document.
toc
TRUE to include a table of contents in the output
toc_depth
Depth of headers to include in table of contents
fig_width
Default width (in inches) for figures
fig_height
Default width (in inches) for figures
fig_retina
Scaling to perform for retina displays. Defaults to NULL which performs no scaling. A setting of 2 will work for all widely used retina displays, but will also result in the output of tags rather than markdown images
dev
Graphics device to use for figure output (defaults to png)
includes
Named list of additional content to include within the document (typically created using the includes function).
md_extensions
Markdown extensions to be added or removed from the default definition or R Markdown. See the rmarkdown_format for additional details.
pandoc_args
Additional command line options to pass to pandoc

Value

  • R Markdown output format to pass to render

Details

See the http://rmarkdown.rstudio.com/markdown_document_format.html{online documentation} for additional details on using the md_document format.

R Markdown documents can have optional metadata that is used to generate a document header that includes the title, author, and date. For more details see the documentation on R Markdown metadata.

R Markdown documents also support citations. You can find more information on the markdown syntax for citations in the http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html{Bibliographies and Citations} article in the online documentation.

Examples

Run this code
library(rmarkdown)

render("input.Rmd", md_document())

render("input.Rmd", md_document(variant = "markdown_github"))

Run the code above in your browser using DataCamp Workspace