我想根据选择动态更改 a 的标题,但box我无法逃脱.shinydashboardselectInput()HTML
library(shiny)
library(shinydashboard)
library(htmltools)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
selectInput("plottype", "Select plot type", c("AP:TOTAL","FF:TOTAL","OVERALL")),
box(title=paste(htmlEscape(textOutput('box1title')),"charts"),
width = 6,
solidHeader = TRUE,
status = "primary",
p('Use the checkbox to change the title of this box.')
)
)
)
server <- function(input, output) {
output$box1title <- renderText({
if(input$plottype=="AP:TOTAL"){
"AP:TOTAL"
}
else if(input$plottype=="FF:TOTAL"){
"FF:TOTAL"
}
else{
"OVERALL"
}
})
}
shinyApp(ui,server)