Shiny R: Populate a list from input and return list on output via reactive -


i try populate list on shiny elements of list passed on shiny input. list should accumulate made choices. list should sent shiny output. list can send output. list of length 1 , single element gets updated input does. interested in "names" of list, why assign value 1 each name element:

ui.r
shinyui(     fluidrow(            column(1,             # reactive input              selectinput("input1",                          label = "select parameter 1",                         choices = c("none",letters[1:16]),                         multiple = t),             selectinput("input2",                          label = "select parameter 2",                                 choices = c("none",c(1:24) )                         multiple = t),                     # printout of list             htmloutput("printoutlist")         ) # end of column     ) # end of fluid row ) # end of shiny ui 

shiny.r

# create empty list container <- list() shinyserver(function(input, output) {      # pass on input reactive     inputinfo <- reactive({         if(input$input1 == "none" | input$input2 == "none") {             "-"                        } else {              paste(input$input1 ,input$input2, sep = "")         }     })       # fill list , pass on list output      output$printoutlist <- renderui({                             container[[inputinfo()]] <- 1         paste("you have chosen: ", names(container), sep = "")             })   )} #end of shinyserver function  

any idea how solve this? tried around lot... unfortunately quite new r, shiny ! appreciate kind of help! !

include multiple = true argument selectinput

 selectinput("input1",             label = "select parameter 1",           choices = c("none",letters[1:16]),           multiple = true            ) 

but seems server , ui files mixed , don't have shinyserver function in code.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -