MulaiMulai sekarang secara gratis

The body, and completing the UI

You have set up the header and sidebar Now, you can set up the body.

This is a crucial part of the wireframing process, since it will help you decide where to position your outputs and inputs in their desired positions within the main body of the dashboard.

In this exercise, you will place several outputs and inputs in the dashboard. In doing so, you will obtain all three components of the user interface, which will be put together in dashboardPage().

Latihan ini adalah bagian dari kursus

Building Dashboards with shinydashboard

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

header <- dashboardHeader(title = "Soccer tournament")

sidebar <- dashboardSidebar(
  sidebarMenu(
    menuItem("Matches", tabName = "matchtab", icon = icon("futbol")), 
    menuItem("General statistics", tabName = "statstab", icon = icon("chart-line")) 
  )
)

body <- dashboardBody(tabItems(
  tabItem(tabName = "matchtab", 
  fluidRow(selectInput("match", "Match number", choices = 1:nrow(soccer))) 
         ),
  # See that the second tab should contain three sub-tabs
  ___(tabName = ___, 
          ___(tabPanel("Goals"), 
                 ___("Yellow cards"),
                 ___(___))
         )
))
Edit dan Jalankan Kode