我正在构建一个闪亮的应用程序,在那里我希望主面板是动态的,这样可以选择一个下拉菜单时,创建了新的绘图。我了解如何在绘图彼此重叠的情况下执行此操作(这很糟糕,因为我在其下方有表格并且用户必须向下滚动)。如果主面板图只是“切换”,那就太好了。我不确定 ConditinalPanel 是否可以在这里工作?甚至是 Switch 语句?这是我的用户界面。
source("DATA CLEANING.R")
salespeople <- sort(unique(salesdatav3$SALESPERSON))
# Define UI for application that draws a histogram
ui <- fluidPage(theme = shinytheme("united"),
# Application title
titlePanel("Pounds_New"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
pickerInput("slsp", "SalesPerson", choices = salespeople, selected =NULL, options = list(`actions-box` = TRUE), multiple = T),
pickerInput("stats", "Summary Stats", choices = as.vector(c("Positive/Negative Count", "Histogram", "Plot Pounds by Time", "Top Ten Positive Trending",
"Top Ten Negative Trending")), selected = NULL, multiple = …Run Code Online (Sandbox Code Playgroud)