I am using this pseudo code to generate dynamic title on an flexdashboard in R
title_Var <- paste("Numurkah", format(max(Data$`Cutt Off daily`), "%d %b %Y"))
which works fine in the R console : Numurkah 09 Oct 2018
but when I use it inside the RMD file, (this code is inserted after I defined my variable in r)
---
title: \`r title_Var`\
---
it render in the HTML file as 09 Oct 2018 so YAML get my variable correctly, but it show only the date not the first text " Numurkah"
thanks for the reply, I found the correct answer
---
title: `r title_Var`
---
I think there are some restrictions on which YAML lines R code can execute from (see for example Inline R code in YAML for rmarkdown doesn't run). You can create the title with system parameters, it seems, but not with variables that are identified later in the markdown doc. For example this works:
---
title: '`r paste("Numurkah", format(Sys.Date(), "%d %b %Y"))`'
date: '`r format(Sys.time(), "%d %B %Y")`'
output: html_document
---