I try to make a selection menu like this:
Interactively change the selectInput choices
And everything works well with the exception of one thing: Instead to get the values (like McDonald), I get the indices although I did nothing different (see picture link below). Where could be my mistake?
Here my global.R:
partners<- read.csv("genes.csv", header=TRUE, fill=TRUE)
server.R
shinyServer(function(input, output) {
#subTable
searchResult<- reactive({
subset(partners, grepl(input$nameSearch, partners$name))
})
output$searchResults <- renderTable({
searchResult()[,1]
})
output$selectUI <- renderUI({
selectizeInput("partnerName", "Click in and select", choices=searchResult()[,1], multiple=TRUE )
})
})
ui.R
library(shiny)
shinyUI(pageWithSidebar(
# Give the page a title
titlePanel("Tilte"),
sidebarPanel(
textInput("nameSearch", "Search for name", "Blah"),
htmlOutput("selectUI"),
br(),
submitButton("Update View"),
br()
),
# Create a spot for the barplot
mainPanel(
textOutput("text"),
plotOutput("plot")
)
)
)