title: Passing column name via selectInput in shiny application
body: <p>I have a simple shiny app, I would like to pass the value from the <code>selectInput</code> as a column name of data frame and use it in ggplot. My UI code looks like that:</p>
  
  <pre><code>library(shiny)
  
  # Define UI for application that draws a histogram
  shinyUI(fluidPage(
  
    # Application title
    titlePanel("Title"),
  
    # Sidebar with a slider input for the number of bins
    sidebarLayout(
      sidebarPanel(
        selectInput(inputId = "yaxis", 
                    label = "Y-axis",
                    choices = list("Overall Rank" = "overall_rank", 
                                   "Income Deprivation" = "income_deprivation_rank"), 
                    selected = "income_deprivation_rank"),
  
        selectInput(inputId = "xaxis", 
                    label = "X-axis",
                    choices = list("Overall Rank" = "overall_rank", 
                                   "Income Deprivation" = "income_deprivation_rank"), 
                    selected = "overall_rank")),
  
      # Show a plot of the generated distribution
      mainPanel(
        plotOutput("distPlot"),
        h5("Notes"),
        p("notes")
      )
        )
      ))
  </code></pre>
  
  <p>My server side code is vary simple, I have a SPARQL query (cut here to save the space) that creates simple data frame:</p>
  
  <pre><code># Libs
  require(shiny); require(SPARQL); require(ggplot2)
  
  # Server function
  shinyServer(function(input, output) {
  
    # Source the data
  
    ## Define endpoint URL.
    endpoint &lt;- "http://data.opendatascotland.org/sparql.csv"
  
    ### Create Query 
    query.simd &lt;- "PREFIX stats: &lt;http://statistics.data.gov.uk/id/statistical-geography/&gt;
        (...) cut to save space (...)"
  
    ## Make the data
    dta.simd&lt;- SPARQL(url = endpoint, query = query.simd, format = "csv")$results
  
  
    ## Make the plot
    output$distPlot &lt;- renderPlot({
  
      xaxis &lt;- as.character(input$xaxis) 
      yaxis &lt;- as.character(input$yaxis)
  
      # draw the the plot
      ggplot(data = dta.simd, aes(x = xaxis, y = yaxis)) +
        geom_point(shape=1)
  
  })
  })
  </code></pre>
  
  <p>The query results in a simple data frame, resambling the extract below:</p>
  
  <pre><code>observation overall_rank income_deprivation_rank
  a001        2            6
  a002        10           7
  a003        11           9
  </code></pre>
  
  <p>After compiling the app I keep on receiving the <strong>Error: object 'xaxis' not found</strong>. This leads me to believe that for whatever reason the value from the <code>input$xaxis</code> is not passes to the <code>xaxis</code> object and cannot be used in ggplot. If I decide to replace the <code>as.character(input$yaxis)</code> with a string corresponding to the column name, like for instance <code>overall_rank</code> and the other one <code>income_deprivation_rank</code> the app works as it should, so the problem is clearly associated with using the <code>input$xaxis</code> value. I tried the code with no <code>as.character()</code> function but got the same error message. </p>