Filtering from selectInput in R shiny
<p>I'm trying to have the user upload a .csv file, then take a column (factor) of that .csv file and create user input of to determine which of the unique names in that field will be selected for the data frame.</p>

<p>So if I have the following example data.frame:</p>

<pre><code>    COURSE   VALUE
1      A       7
2      C       2
3      C       2
4      B       9
...
</code></pre>

<p>I'd want to filter using Select_Input and the user can select select say A and C and the data frame would be filtered for just rows with A and C. Below is the code to generate the UI for the select_Input</p>

<pre><code>output$choose_course&lt;-renderUI{
 # If missing input, return to avoid error later in function
if(is.null(input$model.input))
 return()

# Get the data set with the appropriate name
course.names &lt;-c("All",as.vector(t(unique(select_(model.data0(),"COURSE")))))

selectInput("courses","Choose courses", choices=course.names, multiple=TRUE)    
}
</code></pre>

<p>Note that model.data0() is the reactive data entered by the user via a .csv file. This first part of code works ok (but maybe the format is messing up the next stuff?) and displays for the user input selections. And next we have my attempt at filtering from the selectInput...</p>

<pre><code>model.data&lt;-reactive({
if(is.null(input$model.input))
  return()

localdata&lt;-model.data0()
if(input$courses!="All"){
  localdata&lt;-localdata[localdata$COURSE==unlist(input$courses),]
}
})
</code></pre>

<p>However, this returns an error of "argument 1 (type 'list') cannot be handled by 'cat' ". I tried the unlist above to change it to a vector but didn't seem to work. Any ideas how I can make this filter my data?</p>