我的闪亮应用程序具有多个输入,具体取决于所使用的变量数量。下面是一个简化的版本,尽管不起作用。我使用一个用来制作uiOutput的名为Make.UI的函数来使UI根据numericInput进行更新,但是将输入返回服务器已经超出了我的Shiny技能范围!任何建议将不胜感激。
格温
library(shiny)
D = matrix(runif(400), nrow = 20)
colnames(D) = labs = sapply(1:20, function(i) {paste0("col",i)})
# Define UI for application that summarises data
ui <- fluidPage(
# Application title
titlePanel("Summaries"),
# Select columns to get fed into summary
tabsetPanel(
tabPanel("Matching Variables Info",
sidebarPanel(
numericInput("NoVars","No. of variables to summarize",
value = 3, min = 2, max = dim(D)[2]),
uiOutput("VarsInput")
),
# Show summaries of columns choosen above
mainPanel(
verbatimTextOutput("dataInfo")
)
)
)
)
# Define the server code
server <- …Run Code Online (Sandbox Code Playgroud)