title: R Shiny - Passing data into drop-down input selector
body: <p>I'm trying to create a drop-down selector in Shiny. The Shiny tutorial has this code in ui.r:</p>
  
  <pre><code>selectInput("var", 
      label = "Choose a variable to display",
      choices = c("Percent White", "Percent Black",
        "Percent Hispanic", "Percent Asian"),
      selected = "Percent White"),
  </code></pre>
  
  <p>If I go into RStudio and write: </p>
  
  <pre><code>myVar = c("Percent White", "Percent Black",
            "Percent Hispanic", "Percent Asian") 
  </code></pre>
  
  <p>myVar is of type chr.</p>
  
  <p>In my project, I want to load an .RData object in server.r. When I run:</p>
  
  <pre><code>mydata = load("myDataFile.RData")
  </code></pre>
  
  <p>mydata is then of type chr and contains the name of all the objects within the .RData file.</p>
  
  <p>I want to have a drop-down select from everything in mydata (the names of the objects in my .RData file). I'm having trouble passing this mydata list from server.r to ui.r. </p>
  
  <p>If I do anything in server.r like</p>
  
  <pre><code>output$myChoices = c(mydata)
  output$mydat = mydata 
  </code></pre>
  
  <p>and in ui.r like </p>
  
  <pre><code>choices = mydata,
  choices = output$mydata,
  or choices = "mydata",
  </code></pre>
  
  <p>I either get that it doesn't recognize mydata or the only choice available in the dropdown is literally "mydata." </p>
  
  <p>Also, the following successfully prints out all the objects within mydata:</p>
  
  <pre><code>#server.r:
  output$text4 &lt;- renderText({ 
        paste(mydata)
      })
  
  #ui.r:
  textOutput("text4"),
  </code></pre>
  
  <p>It makes sense how "mydata" would literally print "mydata," but that's the syntax to print the text.</p>
  
  <p>Again, I want a drop down to choose from everything within mydata.</p>
  
  <p>Thanks so much for the help!</p>