在RShiny中以反应方式修改UI输入

在RShiny中以反应方式修改UI输入,r,shiny,R,Shiny,以下是我的示例UI: library(shiny) ui <- fluidPage( titlePanel("Carry Selector"), sidebarPanel( fluidRow( column(6,numericInput(inputId = 'legNumbers',label = 'Number of Legs',min = 1,max=4,step=1,value=2)) ), t

以下是我的示例UI:

library(shiny)
ui <- fluidPage(

    titlePanel("Carry Selector"),
    sidebarPanel(
        fluidRow(
            column(6,numericInput(inputId = 'legNumbers',label = 'Number of Legs',min = 1,max=4,step=1,value=2))
        ),
        tags$hr(style="border-color: black;"),
        fluidRow(
            column(6,numericInput(inputId = 'weight1Input',label = 'Weight',min = 0,max=10,step=0.25,value=1))
        )
    ),
    mainPanel(
    )
)
库(闪亮)
ui找到了答案:

ui <- fluidPage(

    titlePanel("TEST"),
    sidebarPanel(
        fluidRow(
            column(6,numericInput(inputId = 'legNumbers',label = 'Number of Legs',min = 1,max=4,step=1,value=2))
        ),
        tags$hr(style="border-color: black;"),
        uiOutput("ui_test")
    ),
    mainPanel(
    )
)


server <- function(input,output){
    output$ui_test <- renderUI({
        fluidRow(
            column(6,numericInput(inputId = 'weight1Input',label = 'Weight',min = 0,max=10,step=0.25,value=input$legNumbers))
        )
    })  
}
ui