У меня блестящая приборная панель с двумя tabPanels .Первая вкладка с инфобоксами с выбором диапазона дат и вторая с радиокнопками выбор для инфобоксами .Второй с radiobuttons работает нормально, когда выбор диапазона дат не существует, есть первая tabpanel .Но когда я добавляю выбор диапазона дат к первой вкладке , тогда радиокнопки не работают во второй вкладке .Почему радиокнопки не работают при добавлении функции выбора диапазона дат в первой «вкладке»?
Вот мой код:
library(shiny)
library(shinydashboard)
library(ECharts2Shiny)
dat1 <- data.frame(
name = c("Male", "Female"),
value = c(10, 20)
)
dat2 <- data.frame(
name = c("Male", "Female"),
value = c(30, 40)
)
ui <- shinyUI(dashboardPage(
dashboardHeader(title = "123"),
dashboardSidebar(disable = TRUE),
dashboardBody(fluidPage(
tabsetPanel(
tabPanel(h5("Beneficiaries"),
fluidRow(radioButtons("Bene", "Details", c("Vis","Scre", "Sus"), inline = T),
infoBoxOutput("loc", width = 960),
loadEChartsLibrary(),
tags$div(id="test5", style="width:60%;height:300px;"),
deliverChart(div_id = "test5"), width = "800px", height = "400px")),
tabPanel(h5("summary"),
box(
infoBoxOutput("first", width = 6),
infoBoxOutput("second", width = 6), width = 8
),
box(h4("Date selection"), dateRangeInput("dateRange", "Select date range:", width =
200, submitButton(text = "Submit", icon = NULL, width = 4))
)
)
))))
server <- shinyServer(function(input,output){
output$loc <- renderInfoBox({
if (input$Ben == "Vis"){
box(h3("Vis"),
infoBox("Total", 1, width = 4),
infoBox("part", 1, width = 4),
renderPieChart(div_id = "test1", data = dat1, show.label = TRUE),
background = "black")
}
else {if (input$Ben == "Scre") {
box(h3("Scre"),
infoBox("Total", 2, width = 4),
infoBox("part", 1, width = 4),
renderPieChart(div_id = "test1", data = dat2, show.label = TRUE),
background = "black")
}
else{ box(h3("Sus"),
infoBox("Full", 3, width = 12)
)
} }}
})
})
shinyApp(ui,server)
Может кто-нибудь помочь в этом?Заранее большое спасибо.