I want to create a large table to create some tables after that table in a Shiny app.
This is a part of my server.R
:
function(input, output) {
output$year <- renderText(input$year)
################################
# CONFLICTING PART OF THE CODE
year <- reactive({
as.character(input$year)
})
matrix = tbl_df(dbReadTable(rca_matrices_db, reactive(paste0("table_",year))))
################################
my_table = matrix %>% ... BLA BLA BLA
output$more_than_10 <- DT::renderDataTable(DT::datatable({
mytable %>% select(X1,X2) %>% filter(X1 > 10)
}))
output$less_than_10 <- DT::renderDataTable(DT::datatable({
mytable %>% select(X1,X2) %>% filter(X1 < 10)
}))
}
)
And the year
comes from this part of ui.R
sidebarPanel(
selectInput('year', 'Year', c("Select year",1999:2015), selected = 1999)
)
If I replace, in the conflicting part of server.R
, the year
variable for
year <- 2000
then it works
any ideas?