Manipulate RMarkdown metadata from within R code chunks -


in short: there way manipulate rmarkdown's metadata-list generated yaml header within following r-code chunks? illustrate, i've tried following:

--- title: "untitled" output: html_document ---  ```{r} rmarkdown::metadata$title <- "new title" rmarkdown::metadata$title ``` 

this throws error, though.

error in rmarkdown::metadata$title <- "new title" :    object 'rmarkdown' not found 

background

i'm working on rmarkdown tex-template. parts of preamble need localized depending on variable lang defined in yaml header. current approach check value of metadata$lang , create list of corresponding terms. wanted add contents of list metadata , access terms in tex-template via $loc_wordcount$, example.


Comments