Body 구성과 UI 완성하기
이미 header 와 sidebar 를 설정하셨습니다. 이제 body 를 구성해 보겠습니다.
이 단계는 대시보드의 메인 본문에서 결과물과 입력 요소를 어디에 배치할지 결정하는 와이어프레이밍 과정의 핵심입니다.
이번 연습에서는 대시보드에 여러 결과물과 입력 요소를 배치합니다. 이렇게 하면 사용자 인터페이스의 세 가지 구성 요소를 모두 갖추게 되며, 이를 dashboardPage() 에 모아 완성합니다.
<이 대시보드는 일부 숨겨진 함수 때문에 로컬에서 그대로 재현할 수 없음을 안내하세요.>이>
이 연습은 강의의 일부입니다
shinydashboard로 대시보드 만들기
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
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"),
___(___))
)
))