R/Shiny/bs4Dash에서 InfoBox

6289 단어 RShinybs4DashAdminLTE
이런 느낌.
library(shiny)
library(bs4Dash)

ui <- bs4DashPage(
  navbar = bs4DashNavbar(),
  sidebar = bs4DashSidebar(
    bs4SidebarMenu(
    )
  ),
  body = bs4DashBody(
    fluidRow(
      bs4InfoBox(
        title = "Sepal.Length",
        value = iris$Sepal.Length[nrow(iris)],
        icon = "pie-chart",
        status = "primary",
        width = 4
      ),
      bs4InfoBoxOutput(
        outputId = "ib",
        width = 8
      )
    )
  ),
  controlbar = bs4DashControlbar(),
  footer = bs4DashFooter(),
  title = "yono2844"
)

server <- function(input, output, session) {
  output$ib <- renderbs4InfoBox(expr = {
    bs4InfoBox(
      title = "Sepal.Width",
      value = iris$Sepal.Width[nrow(iris)],
      icon = "bar-chart",
      status = "warning"
    )
  })
}

shinyApp(ui = ui, server = server)

좋은 웹페이지 즐겨찾기