I'm making a shiny app that displays the datatable with the results of a database query. I use an in-house package for retrieving the data and I'm sure this works correctly.
When I want to display the datatable from one of the db's I have no problems, but when I want to display the other the table simply doesn't appear.
I use the reactive function to retrieve the data and renderDataTable() for displaying it. Here is the code:
shinyServer(function(input, output) {
dataset <- reactive({
if(input$experiment!=""&!is.null(input$experiment)){
if(input$db=="db1"){
data <- querydb1(experimentID=input$experiment)
}
if(input$db=="db2"){
data <- querydb2(experimentID=input$experiment)
}
}
})
# output table
output$data <- renderDataTable({
dataset()
})
})
data<-from before thequerydb..statements does that help? - John Paul