Hi everyone,
I've got a very basic data table in Shiny, acheived using just a few lines (followed from a tutorial I found). The associated csv file is called DATASET1.csv (code is pasted below).
The output is a table that looks like this, which is just what I wanted :
However, I need to now integrate DATASET2.csv and DATASET3.csv. See where the dropdown menu is prompting to show 10 (15/25/etc) entries? I'm looking for a way to have another dropdown menu beside it that allows for selection of DATASET1, DATASET2, or DATASET3.
Any ideas?
Thanks!
Code for DATASET1 :
...library(shiny) # Shiny web app
library(DT) # for data tables
# user interface just shows the table
ui <- fluidPage(fluidRow(column(12, div(dataTableOutput("dataTable")))))
# server is where all calculations are done, tables are pre-rendered
server <- function(input, output, session) {
# load CSV file
myCSV <- read.csv('DATASET1.csv')
#-----------------------------------------------------------------------------
# render data table
#-----------------------------------------------------------------------------
output$dataTable <- renderDT(
myCSV, # data
class = "display nowrap compact", # style
filter = "top" # location of column filters
)
}
# run the app
shinyApp(ui, server)