RMD YAML variable header

I'd like to be able to use a variable as the Title of my rmd file in the YAML header. However, the variable is only loaded into the environment from an rdata file after the YAML (I tried putting the YAML after but anotherone popped up at the start overwriting the moved one).

Is there a way to automate the title of the rmd doc?

1 Like

I think it would depend on how you are defining the variable to be used as the Title and I'm not sure how to do that. You can access R through the YAML header though, here is an example of setting the date using R.

---
title: "Title"
author: "Author"
date: "`r format(Sys.Date(), '%B %d, %Y')`"
output: html_document
---

Hopefully this points you in the right direction for accessing R through the Title field.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.