I'm performing some computationally intensive operations that I would like to generate reports from. I'm experimenting with bookdown or straight rmarkdown. Essentially I'd like an html_document report and a word_document report.
My .Rmd file looks like this:
---
title: "My analysis"
author: "me"
date: '2019-12-17'
output:
bookdown::word_document2:
highlight: tango
df_print: kable
reference_docx: Word_template.docx
toc: yes
toc_depth: 2
fig_caption: yes
bookdown::html_document2:
theme: yeti
highlight: tango
df_print: paged
toc: yes
toc_depth: 2
fig_caption: yes
keep_md: yes
---
***
```{r child = 'index.Rmd', cache=TRUE}
```
```{r child = '01-Read_in_raw_data.Rmd', cache=TRUE}
```
```{r child = '02-Add_analysis.Rmd', cache=TRUE}
```
What happens is that the html and word documents get cached separately, which is a) time-consuming because they are run twice and b) annoying due to some exported files creating problems when caching (they are generated during the first knit operation but already exist for the second and subsequent ones and generate errors).
I've tried generating just the .md file but it doesn't change problem (a) and I just get really ugly reports from .md inputs with pandoc.
Does anyone have a more elegant way of doing this?