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.