Решение с контролем actionButton
и observeEvent
.
library(shiny)
library(DT)
ui <- fluidPage(
fileInput(inputId = "ABC", label = "Input File", multiple = FALSE, accept = NULL,
width = NULL, buttonLabel = "Browse...",
placeholder = "No file selected"),
actionButton(inputId = "submit", label = "Submit"),
dataTableOutput("XX")
)
server <- function(input, output) {
observeEvent( input$submit, {
data <- read.csv(input$ABC$datapath, header = TRUE, sep = ",")
output$XX <- renderDataTable({
datatable(data)
})
})
}
shinyApp(ui, server)