Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. library(shiny)
  2. library(data.table)
  3.  
  4. ui <- fluidPage(
  5. titlePanel("Multiple file uploads"),
  6. sidebarLayout(
  7. sidebarPanel(
  8. fileInput("csvs",
  9. label="Upload CSVs here",
  10. multiple = TRUE)
  11. ),
  12. mainPanel(
  13. textOutput("count")
  14. )
  15. )
  16. )
  17.  
  18. server <- function(input, output) {
  19. mycsvs<-reactive({
  20. rbindlist(lapply(input$csvs$datapath, fread),
  21. use.names = TRUE, fill = TRUE)
  22. })
  23. output$count <- renderText(nrow(mycsvs()))
  24. }
  25.  
  26. shinyApp(ui = ui, server = server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement