I am trying to upload an xlsx file using shiny rstudio. But the data can't be read in. Can anyone help me figure it out?
ui <- fluidPage(titlePanel("AFSI Data Reformat"),
sidebarLayout(
sidebarPanel(
fileInput('file1', 'Choose xlsx file',
accept = c(".xlsx"))),
mainPanel(
tableOutput('file2'))))
Server(function(input, output) {
output$file2 <- renderTable({
inFile <- input$file1
if(is.null(inFile))
return(NULL)
read_excel(paste(inFile$datapath, ".xlsx", sep=""), 1)})
When I clicked 'Run App', and the tried to upload an xlsx file, it shows nothing was read in, 'No file uploaded'.