--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 selectedThanksKarim
ui.R
sidebarLayout(
sidebarPanel(# Select StudiesselectizeInput('StudiesID', 'Studies 1', state.name, multiple = TRUE),server.R
# Select Cases
selectizeInput('CasesID', 'Cases 1', choices=NULL , multiple = TRUE),
))
mainPanel(
verbatimTextOutput('Studies_values'),
tableOutput('Cases_values')
)## 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)
})
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.
runApp(shinyApp( ui = fluidPage(
sidebarLayout( sidebarPanel( # Select Studies
uiOutput("studyIdSelect"), # Select Cases uiOutput("caseIdSelect") ),
mainPanel( verbatimTextOutput('Studies_values'), tableOutput('Cases_values')
)) ), server = function(input, output, session) { ## Select Studies library(cgdsr) cgds <- CGDS("http://www.cbioportal.org/public-portal/") Studies <- getCancerStudies(cgds) output$studyIdSelect <- renderUI({ selectizeInput('StudiesID', 'Studies 1', choices = Studies[, 1], multiple = TRUE)
})
output$Studies_values <- renderPrint({ list(List_Studies = input$StudiesID) })
output$caseIdSelect <- renderUI({ Cases <- lapply(input$StudiesID, function(x) getCaseLists(cgds, x)) Cases <- do.call(rbind, Cases) selectizeInput('CasesID', 'Cases 1', choices = Cases[, 1] , multiple = TRUE)
}) output$Cases_values<- renderPrint({ list(List_Cases = input$CasesID) }) }
))