Depending Choose Prompt

3 views
Skip to first unread message

Karim Mezhoud

unread,
May 25, 2015, 5:16:15 AM5/25/15
to shinyap...@googlegroups.com


Dear All,
I am thinking about depending Choose prompt (selectizeInput).
The second "Choose prompt" depends on the first one.
The first one list the Studies.
The second lists Cases depending which study is selected.

In the following code The Cases are specific for Study 4 (Studies[4,1]).

 I would like to change Studies[4,1] by a variable depending on which study is selected



Thanks
Karim

ui.R


 sidebarLayout(
   sidebarPanel(

# Select Studies
    selectizeInput('StudiesID', 'Studies 1', state.name, multiple = TRUE),


# Select Cases
  selectizeInput('CasesID', 'Cases 1', choices=NULL , multiple = TRUE),

))

mainPanel(
    verbatimTextOutput('Studies_values'),
   tableOutput('Cases_values')
)





server.R

 ## Select Studies
  library(cgdsr)
  cgds<-CGDS("http://www.cbioportal.org/public-portal/")
  Studies <- getCancerStudies(cgds)
  ##
  updateSelectizeInput(session, 'StudiesID', choices = Studies[,1])

  output$Studies_values <- renderPrint({
    list(List_Studies = input$StudiesID)

  })
  ## update Cases
#reactive({
  #output$cases <- renderPrint(input$cases)

  Cases <- getCaseLists(cgds,Studies[4,1])

  updateSelectizeInput(session, 'CasesID', choices = Cases[,1])

 output$Cases_values<- renderPrint({
   list(List_Cases = input$CasesID)
  })

Tareef Kawaf

unread,
May 26, 2015, 8:46:12 AM5/26/15
to Karim Mezhoud, shiny-...@googlegroups.com
Cross posting to the shiny-discuss list since this is more of a shiny question.

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/8e9207c9-1bb9-4774-bcca-63d0ad5bfa06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages