Am trying to create a shiny app that allows user upload excel file to preprocess it. I tried using the following code but the upload file appears only in the server side and the user unable to see it and upload file , what am missing ? note! if I use FileInput function I will be able to preprocess it like rename column name remove column or subset values in particular variable.
library(shiny)
library(readxl)
options(shiny.maxRequestSize = 30*1024^2)
runApp(host="0.0.0.0",port=5050,
list(
ui = fluidPage(
titlePanel("Upload Excel File"),
sidebarLayout(
sidebarPanel(
actionButton("uploada", "Upload"),
),
mainPanel(
tableOutput('contents'),
),
),
),
server = function(input, output){
observeEvent(input$uploada, {
output$contents <- renderTable({read_excel(file.choose())})
})
}
)
)