交互式菜單給定的腳本創建附snapshot.It是使用DT包在R.我想通過選擇輸入「A」,以使表上面的菜單,使得表中創建在第一個SelectInput中,我得到第二個selectInput和兩個滑塊,在第一個SelectInput中選擇「B」,我應該只有第二個SelectInput和滑塊。桌上虹膜沒有需要改變。請幫助和謝謝。添加在R基上SelectInput閃亮
## app.R ##
library(shiny)
library(shinydashboard)
library(DT)
#Declaring the UI
ui <- fluidPage(
titlePanel("Interactive Menu"),
# Create a new Row in the UI for selectInputs
fluidRow(
column(3,
selectInput("names",
"Customer:",
c("A","B"))
)),
fluidRow(
column(4,
selectInput("names",
"Customer:",
c(as.character(iris$Species)))
),
column(4,
sliderInput("slide", "Select the slider one",
min = 75, max = 100,
value = 75, step = 5)
),
column(4,
sliderInput("city", "Select the slider two",
min = 60, max = 100,
value = 60, step = 10)
)),
# Create a new row for the table.
fluidRow(
DT::dataTableOutput("table1")
)
)
#Declaring the Server
server <- function(input, output) {
# Filter data based on selections
output$table1 <- renderDataTable({
datatable(iris, options = list(
searching = FALSE,
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
))
})
}
shinyApp(ui, server)
的[R Shinydashboard顯示/隱藏UI元素基於標籤選擇]可能的複製(https://stackoverflow.com/questions/39987908/r-shinydashboard-showing-hiding-ui-elements-based-on-tab-選擇) –
嗨哈迪克,謝謝,我已經在這個功能,我的問題是,我們可以實現帶有條件面板的selectInput,就像這個鏈接所說的tabset條件面板一樣,還有,如果你有一個工作的例子,請分享。 –
你可以在'renderUI'中使用'conditionalPanel'或'uiOutput'。 – SBista