title: How to insert an normal formula in RMarkdown + Shiny document?
body: <p>By watching Matt Dancho´s video on <a href="https://www.youtube.com/watch?v=qGyHZG6ZqwA&amp;t=310s" rel="nofollow noreferrer">Youtube</a>, I ran into a problem:</p>
  <p>I need to insert the simple formula in my RMarkdown + Shiny report, but I´m finding some issues.
  First, my .yml looks like:</p>
  <pre><code>---
  title: &quot;RMarkdown + Shiny&quot;
  author: &quot;Rodrigo Hermont Ozon&quot;
  date: &quot;`r format(Sys.time(), '%B %d, %Y')`&quot;
  output:
    html_document:
    toc: true
    toc_float: true
  runtime: shiny
  ---
  </code></pre>
  <p>Loading the packages I can do:</p>
  <pre><code>library(tidyverse)
  library(tidyr)
  library(dplyr)
  library(fpp3)
  library(fable)
  library(tsibble)
  library(data.table)
  library(quantmod)
  library(dygraphs)
  library(shiny)
  </code></pre>
  <p>Then I´m using the following datasets:</p>
  <pre><code>CORN &lt;- getSymbols(&quot;CORN&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date())
  
  BZ_F &lt;- getSymbols(&quot;BZ=F&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date())
  
  CL_F &lt;- getSymbols(&quot;CL=F&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date())
  
  XC_F &lt;- getSymbols(&quot;XC=F&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date())
  
  ZW_F &lt;- getSymbols(&quot;ZW=F&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date())
  
  ZS_F &lt;- getSymbols(&quot;ZS=F&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date())
  
  USDBRL_X &lt;- getSymbols(&quot;USDBRL=X&quot;, auto.assign = FALSE,
                  from = &quot;2010-06-09&quot;, end = Sys.Date()) # Real effective exchange rate Brazil/Dollar
  
  dataset &lt;- cbind(
  
  CORN,
  BZ_F,
  CL_F,
  XC_F,
  ZW_F,
  ZS_F,
  USDBRL_X
  
  ) %&gt;% as.data.table() %&gt;% as_tsibble()
  </code></pre>
  <p>Then we can make an interactive dropdown selector for the user:</p>
  <pre><code>
  varSelectInput(
      
    inputId = &quot;selectedvar&quot;,
    label = &quot;Choose a column from the data:&quot;,
    data = dataset[, 
                   colnames(dataset)!= &quot;index&quot; ], # User didn´t select the index 
    selected = &quot;CORN.Close&quot;
    
    )
  
  </code></pre>
  <p>And following I need to input a new RMarkdown chunk can shows me the <code>periodicity()</code> of the selected time series, followed for the last 5 days of the quotes of the selected variable using <code>tail(input$selectedvar)</code> for example, and so on...</p>
  <p>I´m an rookie in Shiny+Rmarkdown and I just want to know if I could use <code>renderPrint({ paste(&quot;The last five prices was: &quot;, tail(input$selectedvar)) })</code> or other solution to see my desired results that could works well.</p>
  <p>Thanks,</p>