Situation: I have one input where you can choose "small" or "big", a csv-file with data and another input, where you can choose from a list from the csv depending on your choice of "small" or "big".
Problem: I cannot find a way to access the variable input$selecter
in the updateSelectizeInput
function.
Here is my minimal code example which unfortunately does not work:
library(shiny)
ui=fluidPage(
selectInput('selecter', "Choose ONE Item", choices = c("small","big")),
selectizeInput('chooser', 'Choose SEVERAL Items', choices = NULL, multiple = TRUE)
)
server=function(input,output,session){
DatafromMytable=read.csv("mytable.csv", header=TRUE, sep=";")
# mysubset=subset(DatafromMytable,Size=="big") #
mysubset=subset(DatafromMytable,Size==input$selecter)
updateSelectizeInput(session, "chooser", choices = mysubset$Item)
}
shinyApp(ui, server)
Question:
What do I need to change in the line updateSelectizeInput(session, "chooser", choices = mysubset$Item)
to make the code work?