Learn R Programming

rmarkdown (version 0.1.2)

word_document: Convert to an MS Word document

Description

Format for converting from R Markdown to an MS Word document.

Usage

word_document(fig_width = 6, fig_height = 4.5, fig_caption = FALSE,
  highlight = "default", reference_docx = "default", data_dir = NULL,
  pandoc_args = NULL)

Arguments

reference_docx

Use the specified file as a style reference in producing a docx file. For best results, the reference docx should be a modified version of a docx file produced using pandoc. Pass "default" to use the rmarkdown default styles.

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", and "haddock". Pass NULL to prevent syntax highlighting.

data_dir

Additional directory to resolve relatives paths of templates and included content against (the directory of the input file is used by default).

pandoc_args

Additional command line options to pass to pandoc

Value

R Markdown output format to pass to render

Details

R Markdown documents can have optional metadata that is used to generate a document header that includes the title, author, and date. Metadata can also be provided to enable the use of footnotes and bibliographies. For more details see the documentation on R Markdown metadata and citations.

Examples

Run this code
# NOT RUN {
library(rmarkdown)

# simple invocation
render("input.Rmd", word_document())

# specify an option for syntax highlighting
render("input.Rmd", word_document(highlight = "zenburn"))
# }

Run the code above in your browser using DataLab