Last active
August 7, 2016 13:56
-
-
Save nlddfn/bca353b840f1cadda92a042d7908e39f to your computer and use it in GitHub Desktop.
Shiny_MIgration_paths_Server.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observe({ | |
# data frames | |
if(input$whichData == 'Daily Arrivals'){ | |
data_stat = balkanRoute} | |
else if(input$whichData == 'Gender'){ | |
data_stat = dataGender2016} | |
else {data_stat = dataOrigin2016} | |
# Column indexes | |
if(input$whichData == 'Daily Arrivals'){ | |
col = col_balkanRoute} | |
else if(input$whichData == 'Gender'){ | |
col = col_gender} | |
else {col = col_demography} | |
updateSelectInput(session, "selected", choices = col, | |
selected = col[1:min(4, length(col))] | |
) | |
# show data using DataTable | |
output$table <- renderDataTable({ | |
datatable(data_stat[,input$selected], rownames=FALSE,selection = 'multiple') %>% | |
formatStyle(input$selected, background="skyblue", fontWeight='bold') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment