This has partially been asked (without any takers) here and I have reached out via comment here - apologies for the multi-pronged approach ...
In my ongoing quest (see here for the example and further aspects) to automated report assembly using bookdown
, I would like to do the following:
Start a paragraph in the
yaml
header like so:--- title: "Test Doc" author: "Balin" date: "May 29, 2018" abstract: "Bare bones abstract." output: bookdown::pdf_document2: toc: no --- This stands in for an extensive report where `code`, its documentation and interpretation of its results are integrated: 1. We load some data: ```{r data-loading} my_data <- cars # PLACEHOLDER (see in text below) # ``` <!-- ... -->
As the processing progresses I aim to edit the
yaml
-deriving abstract, cumulatively assembling/augmenting it. I know aboutrmarkdown::metadata$abstract
(see e.g. here), but themetadata
object appears immutable and can't be edited.I in essence want to replace the
PLACEHOLDER
bit in the example with something like:rmarkdown::metadata$abstract <- paste( rmarkdown::metadata$abstract, "The analyzed dataset contains", nrow(my_data), "data points.")
Can that be achieved?