Learn R Programming

redoc (version 0.1.0.9000)

redoc_extract_rmd: Extract the Rmd used to to produce a Reversible Word Doc

Description

Documents produced with redoc() store an copy of the original .Rmd files used to produce them. This is useful for diffing against the version created with dedoc(), especially if tracked changes have not been used.

Usage

redoc_extract_rmd(docx, type = c("original", "roundtrip"), dir = ".",
  to = NULL, overwrite = FALSE)

Arguments

docx

A path to a word file or a an rdocx object created with officer::read_docx().

type

One of "original" or "roundtrip". "original" extracts the exact document originally knit. "roundtrip" (default) extracts a document that has been converted to Word and back with no edits in between. The latter should be more useful for comparing against edits, as line-wrapping and placement of no-output chunks should match.

dir

The directory to write the `.Rmd`` to. Defaults to current working directory

to

the filename to write the resulting .Rmd file. The default is to use the the original name with either .orignal.Rmd or roundtrip.Rmd extensions.

overwrite

whether to overwrite existing files

Value

The path to the extracted .Rmd

Examples

Run this code
# NOT RUN {
redoc_extract_rmd(redoc_example_docx(), dir = tempdir())
# }

Run the code above in your browser using DataLab