我在动态标签中有数据表,这需要用户输入数据。如何调用这些表并处理动态选项卡中的用户数据?
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)
})
}
))