title: Using a string variable for a column name in Shiny
body: <p>ui.R:</p>
  
  <pre><code>library(shiny)
  shinyUI(  fluidPage(fluidRow(
      column(input$PYR,
           style = 'padding:25px',
           textInput("N_PYR", NULL, width = '192px'),
           textInput("RATE_PYR", NULL, width = '192px'),
           width = 3),
      column(input$CYR,
             style = 'padding:25px',
             textInput("N_CYR", NULL, width = '192px'),
             textInput("RATE_CYR", NULL, width = '192px'),
             width = 3)
  
    )))
  </code></pre>
  
  <p>server.R:</p>
  
  <pre><code>library(shiny)
  shinyServer(function(input, output, session) {
    # current year ("2015-16" for example)
    input$CYR &lt;- reactive({"2015-16"})
  
    input$PYR &lt;- reactive({paste0(
      as.numeric(substr(input$CYR, start = 1, stop = 4)-1),
      "-",
      as.numeric(substr(input$CYR, start = 6, stop = 7)-1))
      })
  
    # terminate when window is closed
    session$onSessionEnded(function() { stopApp() })
  
  })
  </code></pre>
  
  <p>If ui.R is changed to</p>
  
  <pre><code>library(shiny)
  shinyUI(  fluidPage(fluidRow(
      column("2014-15",
           style = 'padding:25px',
           textInput("N_PYR", NULL, width = '192px'),
           textInput("RATE_PYR", NULL, width = '192px'),
           width = 3),
      column("2015-16",
             style = 'padding:25px',
             textInput("N_CYR", NULL, width = '192px'),
             textInput("RATE_CYR", NULL, width = '192px'),
             width = 3)
  
    )))
  </code></pre>
  
  <p>this is the desired product:</p>
  
  <p><a href="https://i.stack.imgur.com/kHO2x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kHO2x.png" alt="enter image description here"></a></p>
  
  <p><strong>Goal</strong>: declare a string variable whose value will <strong>NOT</strong> be given from the user's end (this will be manually changed in the R code), so that the UI is updated whenever the CYR value is changed. It does not matter whether this variable is declared in ui.R or server.R.</p>