我正在尝试使用 Shiny 中的选项卡编写一个应用程序,该应用程序引用来自文本框的相同输入。
输入:
column(2, textInput(inputId = "sh1", label = "Stakeholder #1's name"))
输出:
tabPanel("#1 vs #2",
fluidRow(
column(3),
column(2, textOutput(outputId = "sh1o")),
column(2, "vs"),
column(2, textOutput(outputId = "sh2o"))
),
tabPanel("#1 vs #3",
fluidRow(
column(3),
column(2, textOutput(outputId = "sh1o")),
column(2, "vs"),
column(2, textOutput(outputId = "sh3o"))
),
Run Code Online (Sandbox Code Playgroud)
渲染:
output$sh1o <- renderText(input$sh1)
据我所知,Shiny 不允许多次使用输入。
有什么办法可以使这项工作?
可以将相同的输入分配给临时变量,然后分配给输出吗?