我想放置两个“ checkboxInput”以按照复选框显示值。 一个 checkboxInput 用于“ cat1”框,另一个 checkboxInput 用于“ cat2”框。 这样就可以使用“ cat1”和“ cat2”值进行切换。
有人可以帮我吗?
代码:
library(shiny)
a = 100
b = 90
c = 80
d = 70
e = 60
f = 50
ui <- shinyUI(
dashboardPage(skin = "yellow",
dashboardHeader(title = "Try"),
dashboardSidebar(
sidebarMenu(menuItem("abc", tabName = "super"),
menuItem("def", tabName = "duper"))),
dashboardBody(
fluidPage(h1("Dashboard"),
mainPanel(
tabsetPanel(
tabPanel(h5("Categories"),
box(h3("cat1"),
infoBox("a", a, "Scr", icon = icon('users'), color = "blue", width = 6),
infoBox("b", b, "pos", icon = icon('users'), color = "blue", width = 6)),
box(h3("cat2"),
infoBox("c", c, "ref", icon = icon('random'), color = "blue", width = 6),
infoBox("d", d, "vis", icon = icon('random'), color = "blue", width = 6))
)))))))
server <- function(input, output) {
}
shinyApp(ui, server)