0

我在动态选项卡中有数据表,需要用户输入数据。如何调用这些表并处理来自动态选项卡的用户数据?

library(shiny)
library(rhandsontable)

DF <- data.frame(sample=c(350292, 350293), test=c(2, 3))

runApp(list(
  ui = pageWithSidebar(
    headerPanel('Dynamic Tabs'),
    sidebarPanel(
      numericInput("nTabs", 'No. of Tabs', 5)
    ),
    mainPanel(
      uiOutput('mytabs')  
    )
  ),
  server = function(input, output, session){
    output$mytabs = renderUI({
      nTabs = input$nTabs
      myTabs = lapply(paste('Tab', 1: nTabs), tabPanel,
                  rhandsontable(DF))
      do.call(tabsetPanel, myTabs)
    })
  }
))
4

0 回答 0