title: Rmarkdown: Word Document with Variable in Title
body: <p>Something similar was asked a few years ago, but I do not think that it exactly fits my case.</p>
  <p><a href="https://stackoverflow.com/questions/40892121/variable-as-title-in-rmarkdown">Variable as title in rmarkdown</a></p>
  <p>Look at the snippet below. I would like the variable x to appear in the title of my word document. In reality x is the result of some computations (data is read and modified, but I believe this is not fundamental at this stage).</p>
  <pre><code>  ---
    title: &quot;Country Focus in the Year x.&quot;
    output: word_document
    ---
  
  
   ```{r seq, echo=FALSE, eval=T}
    x&lt;-2020
    ```
  </code></pre>
  <p>It must be trivial, but I am banging my head against the wall.
  Any idea?
  Thanks!</p>