【发布时间】:2015-11-18 11:42:33
【问题描述】:
I'd like to build a dashboard sidebar that has maybe 3 menuItems and when a menuItem is selected a checkBoxGroup will expand below and the user can select any number of options.我该怎么办?
这是我目前拥有的代码的相关部分。
# ui.R
dashboardSidebar(
# I need a header to say Select a Dataset
# I want the menuItems to be selectable but
menuItem("Dataset 1", newTab = FALSE),
menuItem("Dataset 2", newTab = FALSE),
menuItem("Dataset 3", newTab = FALSE),
# not sure where to put uiOutput so that it appears below
# the selected menuItem
uiOutput("features")
)
# server.R
dataset <- reactive({
df <- read.csv()
return(df)
})
output$features <- renderUI({
checkboxGroupInput("features", "Select features to plot: ",
colnames(df))
})
【问题讨论】:
-
您将需要探索
renderUI和outputUI,这将取决于其他输入。尝试使用一些代码,然后我们可以帮助您更好地理解它。
标签: r shiny rstudio shinydashboard