Skip to content

Instantly share code, notes, and snippets.

@stephlocke
Last active April 2, 2024 09:21

Revisions

  1. stephlocke revised this gist Apr 17, 2017. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions app.R
    Original file line number Diff line number Diff line change
    @@ -16,13 +16,11 @@ ui <- fluidPage(
    )

    server <- function(input, output) {

    mycsvs<-reactive({
    rbindlist(lapply(input$csvs$datapath, fread),
    use.names = TRUE, fill = TRUE)
    })

    output$count <- renderText(nrow(mycsvs()))
    output$count <- renderText(nrow(mycsvs()))
    }

    shinyApp(ui = ui, server = server)
  2. stephlocke renamed this gist Apr 17, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. stephlocke created this gist Apr 17, 2017.
    28 changes: 28 additions & 0 deletions shiny.R
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    library(shiny)
    library(data.table)

    ui <- fluidPage(
    titlePanel("Multiple file uploads"),
    sidebarLayout(
    sidebarPanel(
    fileInput("csvs",
    label="Upload CSVs here",
    multiple = TRUE)
    ),
    mainPanel(
    textOutput("count")
    )
    )
    )

    server <- function(input, output) {

    mycsvs<-reactive({
    rbindlist(lapply(input$csvs$datapath, fread),
    use.names = TRUE, fill = TRUE)
    })

    output$count <- renderText(nrow(mycsvs()))
    }

    shinyApp(ui = ui, server = server)