R build status version cranlogs Active

{officedown} is bringing some officer features into R markdown documents.

Overview

Word

The package facilitates the formatting of Microsoft Word documents produced by R Markdown documents by providing a range of features:

officedown logo

PowerPoint

The package also enhances PowerPoint productions with R Markdown by providing a mechanism for placing results according to the slide template contained in the PowerPoint document used as “reference_doc”. It becomes easy to add several contents in the same slide.

The package also offers the possibility to transform your graphic instructions into editable vector graphics (with the rvg package) by simply wrapping your call into a call to function dml.

Ressources

The help pages are in a bookdown located at:

https://ardata-fr.github.io/officeverse/

Manuals are available at:

https://davidgohel.github.io/officedown/.

Installation

You can install {officedown} from github with:

remotes::install_github("davidgohel/officedown")

Supported formats require some minimum pandoc versions:

R Markdown output pandoc version
Microsoft Word >= 2.0
Microsoft PowerPoint >= 2.4

Getting started

rdocx_document

use RStudio Menu to create a document from {officedown} template.

It creates an R markdown document, parameter output is set to officedown::rdocx_document. Note that package {officedown} need to be loaded in the Rmd.

Word Features illustration

A bookdown is available in the package and can be used as a demo.

dir <- system.file(package = "officedown", "examples", "bookdown")
file.copy(dir, getwd(), recursive = TRUE, overwrite = TRUE)
#> [1] TRUE
# rmarkdown::render_site("bookdown")
fs::dir_tree("bookdown", recurse = TRUE)
#> bookdown
#> ├── 01-intro.Rmd
#> ├── 02-toc.Rmd
#> ├── 03-tables.Rmd
#> ├── 04-sections.Rmd
#> ├── 05-plots.Rmd
#> ├── _bookdown.yml
#> ├── _output.yml
#> ├── bookdown.Rproj
#> ├── index.Rmd
#> └── template.docx

You should see the following document: