title: How can symbols be used in a Shiny table header?
body: <blockquote>
    <p><strong>Objective:</strong> Use math symbols in column titles for a Shiny App.  </p>
  </blockquote>
  
  <p>For example, x-bar or beta, alpha etc.</p>
  
  <p>Below is what I've tried, which yields strange results (see image).  </p>
  
  <p>I've also tried using and expression, which gave this error: <code>Warning: Error in as.data.frame.default: cannot coerce class ""expression"" to a data.frame</code></p>
  
  <p><strong>ui.R file:</strong></p>
  
  <pre><code>library(shiny)
  
  shinyUI(pageWithSidebar(
    headerPanel("Hello Shiny!"),
    sidebarPanel(),
    mainPanel(
      tableOutput("mytable"),
      tableOutput("mytable2")
    )
  ))
  </code></pre>
  
  <p><strong>server.R file:</strong></p>
  
  <pre><code>library(shiny)
  
  shinyServer(function(input, output) {
  
    mytable &lt;- reactive({
      iris2 &lt;- iris
      colnames(iris2) &lt;-  c("Sepal.Length", "Sepal.Width","$m^r_t$", "$\\delta p_t$","$R^r_t$")
    })
  
    output$mytable &lt;-  renderTable(head(iris,5))
    output$mytable2 &lt;-  renderTable(mytable())
  
  })
  </code></pre>
  
  <p><strong>Output:</strong>
  <a href="https://i.stack.imgur.com/AJ0ul.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJ0ul.png" alt="enter image description here"></a></p>