YES!! The output$Listnames is answering the question, "what are the names of the uploaded files"
But for how to access them, let's say I wanted to plot each uploaded file (all of which happen to be a single column). Won't I need some way to put them in a list? And do something like
for(i in 1:seq_along(mylist)){
plot(mylist[[i]]
}
?
I think maybe this is how I should start (modified your example). But I'm not sure how to make all 3 plots, it can only plot 1 of the uploaded files:
library(shiny)
library(data.table)
ui <- fluidPage(
titlePanel("Multiple file uploads"),
sidebarLayout(
sidebarPanel(
fileInput("csvs",
label="Upload CSVs here",
multiple = TRUE)
),
mainPanel(
textOutput("count"),
textOutput(("Listnames")),
tableOutput("FirstDF"),
plotOutput("myplot")
)
)
)
server <- function(input, output) {
mycsvs<-reactive({
# list( rbindlist(lapply(input$csvs$datapath, fread),
# use.names = TRUE, fill = TRUE))
tmp <- lapply(input$csvs$datapath, fread)
names(tmp) <- input$csvs$name
tmp
})
output$count <- renderText(length(mycsvs()))
output$Listnames <- renderText(names(mycsvs()))
output$FirstDF <- renderTable(mycsvs()[[1]], rownames = FALSE)
output$myplot <- renderPlot(
for(i in 1:seq_along(mycsvs)){
x <- plot(mycsvs()[[1]])
x
}
)
}
shinyApp(ui = ui, server = server)