你好,
我很新闪亮的应用程序。当我选择我的数据从excel文件,我想选择表,并在应用程序上显示它。
我使用reactive在SelectInput上显示和选择数据表的名称,但当我更改选择表时,它显示为1s并返回到第一个表。我的代码有什么问题?
谢谢你!
library(shiny) library(readxl) ui <- fluidPage(fileInput('file1', 'Input'), selectInput('sheet', 'Afficher sheet', ""), tableOutput('table')) server <- function(Input, output, session) {data <- reactive({req(Input $file1) ## ?req # require that Input is available inFile <- Input $file1 updateSelectInput(session, inputId = 'sheet', choices = excel_sheets(inFile$datapath)) my_data <- read_excel(inFile$datapath,返回(my_data)})输出$table <- renderTable({data()})} shinyApp(ui, server)