I've got an Rmarkdown template that works well, and I've parameterized it so I can generate variants of the same report from different data sources. However, I'd like to change the title of the report in each case. How do I do that?
Here's the YAML header I have so far:
---
title: "My Title"
author: "Me, Inc."
date: "August 4, 2015"
output: pdf_document
params:
title: default
---
I've tried using params=list(title="ASDF")
in the call to rmarkdown::render
, and although my code can see that variable, it doesn't change the title. I've also tried using r params$title
in the YAML, but that gives a syntax error.
Is there something else I should be trying? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…